Rework Mystery Booster and adjust some set classifications (#12138)

Mystery Booster rework:
* added images download support from scryfall (closes #11806);
* added virtual sets support (remix);
* fixed Commander set name (closes #12110);
This commit is contained in:
xenohedron 2024-04-23 01:28:40 -04:00 committed by GitHub
parent 9f52c8946e
commit 9566e23d0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1939 additions and 3684 deletions

View file

@ -675,4 +675,13 @@ public abstract class ExpansionSet implements Serializable {
return numBoosterDoubleFaced;
}
protected static void addCardInfoToList(List<CardInfo> boosterList, String name, String expansion, String cardNumber) {
CardInfo cardInfo = CardRepository.instance.findCardWithPreferredSetAndNumber(name, expansion, cardNumber);
if (cardInfo != null && cardInfo.getSetCode().equals(expansion) && cardInfo.getCardNumber().equals(cardNumber)) {
boosterList.add(cardInfo);
} else {
throw new IllegalStateException("CardInfo not found: " + name + " (" + expansion + ":" + cardNumber + ")");
}
}
}

View file

@ -12,7 +12,8 @@ public enum SetType {
SUPPLEMENTAL_STANDARD_LEGAL("Standard Legal Supplemental"),
SUPPLEMENTAL_MODERN_LEGAL("Modern Legal Supplemental"),
PROMOTIONAL("Promotional"),
JOKESET("Joke Set"),
REMIX("Remix"),
JOKE_SET("Joke Set"),
CUSTOM_SET("Unofficial Set");
private final String text;
@ -31,12 +32,12 @@ public enum SetType {
}
public boolean isJokeSet() {
return this == SetType.JOKESET;
return this == SetType.JOKE_SET;
}
public boolean isEternalLegal() {
// any official sets except un-sets
return this != SetType.CUSTOM_SET && this != SetType.JOKESET && this != SetType.MAGIC_ARENA;
return this != SetType.CUSTOM_SET && this != SetType.JOKE_SET && this != SetType.MAGIC_ARENA;
}
public boolean isStandardLegal() {