mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Added verify test to check missing second face cards in sets, fixed missing cards;
This commit is contained in:
parent
7aac355f4a
commit
1b430e5d99
9 changed files with 99 additions and 34 deletions
|
|
@ -32,4 +32,16 @@ public final class MtgJsonCard {
|
|||
public String layout;
|
||||
public boolean isFullArt;
|
||||
public List<String> printings; // set codes with that card
|
||||
|
||||
public String getRealCardName() {
|
||||
// double faces cards must be split in different cards in xmage (so use faceName instead name)
|
||||
// for card searching
|
||||
if ("transform".equals(layout)
|
||||
|| "flip".equals(layout)
|
||||
|| "adventure".equals(layout)
|
||||
|| "meld".equals(layout)) { // TODO: remove or keep after mtgjson's meld bug resolve https://github.com/mtgjson/mtgjson/issues/661
|
||||
return faceName;
|
||||
}
|
||||
return asciiName != null ? asciiName : name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public final class MtgJsonService {
|
|||
|
||||
String needName = convertXmageToMtgJsonCardName(name);
|
||||
return set.cards.stream()
|
||||
.filter(c -> needName.equals(c.name) || needName.equals(c.asciiName) || needName.equals(c.faceName))
|
||||
.filter(c -> needName.equals(c.getRealCardName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ public final class MtgJsonService {
|
|||
public HashMap<String, ArrayList<MtgJsonCard>> data;
|
||||
|
||||
private boolean containsSameNames(ArrayList<MtgJsonCard> list) {
|
||||
Set<String> names = list.stream().map(c -> c.name).collect(Collectors.toSet());
|
||||
Set<String> names = list.stream().map(MtgJsonCard::getRealCardName).collect(Collectors.toSet());
|
||||
return names.size() == 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue