mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
Fixed function that reads unimplemented cards
This commit is contained in:
parent
529de2f8cf
commit
d050c80de0
1 changed files with 16 additions and 11 deletions
|
@ -220,15 +220,15 @@ public class CardsStorage {
|
|||
return;
|
||||
}
|
||||
Scanner scanner = new Scanner(is);
|
||||
UnimplementedCardImpl cardToAdd = new UnimplementedCardImpl(tmp);
|
||||
UnimplementedCardImpl cardToAdd = null;
|
||||
boolean addCard = false;
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine();
|
||||
String[] s = line.split("\\|");
|
||||
UnimplementedCardImpl card = new UnimplementedCardImpl(tmp);
|
||||
if (s.length == 2) {
|
||||
String name = s[1].trim();
|
||||
if (!names.contains(set + name)) {
|
||||
UnimplementedCardImpl card = new UnimplementedCardImpl(tmp);
|
||||
Integer cid;
|
||||
boolean secondFace = false;
|
||||
if (s[0].endsWith("a")) {
|
||||
|
@ -236,7 +236,9 @@ public class CardsStorage {
|
|||
} else if (s[0].endsWith("b")) {
|
||||
cid = Integer.parseInt(s[0].replace("b", ""));
|
||||
secondFace = true;
|
||||
addCard = true;
|
||||
if (cardToAdd != null) {
|
||||
addCard = true;
|
||||
}
|
||||
} else {
|
||||
cid = Integer.parseInt(s[0]);
|
||||
addCard = true;
|
||||
|
@ -247,19 +249,22 @@ public class CardsStorage {
|
|||
card.setRarity(Constants.Rarity.NA); // mark as not implemented
|
||||
card.getCardType().clear();
|
||||
if (secondFace) {
|
||||
cardToAdd.setCanTransform(true);
|
||||
cardToAdd.setSecondSideCard(card);
|
||||
card.setCanTransform(true);
|
||||
card.setNightCard(true);
|
||||
if (cardToAdd != null) {
|
||||
cardToAdd.setCanTransform(true);
|
||||
cardToAdd.setSecondSideCard(card);
|
||||
card.setCanTransform(true);
|
||||
card.setNightCard(true);
|
||||
}
|
||||
} else {
|
||||
cardToAdd = card;
|
||||
}
|
||||
if (addCard) {
|
||||
cards.add(cardToAdd);
|
||||
cardToAdd = null;
|
||||
addCard = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addCard) {
|
||||
cards.add(cardToAdd);
|
||||
addCard = false;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Add table
Reference in a new issue