Update check

This commit is contained in:
Anthony Calosa
2021-03-10 12:23:09 +08:00
parent 8f62e32f37
commit ecb5f4d2c3

View File

@@ -171,13 +171,13 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
List<String> missingCards = new ArrayList<>();
CardEdition upcomingSet = null;
Date today = new Date();
boolean skip = false;
List<String> skippedCardName = new ArrayList<>();
for (CardEdition e : editions.getOrderedEditions()) {
boolean coreOrExpSet = e.getType() == CardEdition.Type.CORE || e.getType() == CardEdition.Type.EXPANSION;
boolean isCoreExpSet = coreOrExpSet || e.getType() == CardEdition.Type.REPRINT;
//todo sets with nonlegal cards should have tags in them so we don't need to specify the code here
skip = !loadNonLegalCards && (e.getType() == CardEdition.Type.FUNNY || e.getBorderColor() == CardEdition.BorderColor.SILVER);
boolean skip = !loadNonLegalCards && (e.getType() == CardEdition.Type.FUNNY || e.getBorderColor() == CardEdition.BorderColor.SILVER);
if (logMissingPerEdition && isCoreExpSet) {
System.out.print(e.getName() + " (" + e.getAllCardsInSet().size() + " cards)");
}
@@ -188,8 +188,10 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
for (CardEdition.CardInSet cis : e.getAllCardsInSet()) {
CardRules cr = rulesByName.get(cis.name);
if (cr != null && !cr.getType().isBasicLand() && skip)
if (cr != null && !cr.getType().isBasicLand() && skip) {
skippedCardName.add(cis.name);
continue;
}
if (cr != null) {
addSetCard(e, cis, cr);
@@ -226,7 +228,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
if (!contains(cr.getName())) {
if (upcomingSet != null) {
addCard(new PaperCard(cr, upcomingSet.getCode(), CardRarity.Unknown, 1));
} else if(enableUnknownCards && !skip) {
} else if(enableUnknownCards && !skippedCardName.contains(cr.getName())) {
System.err.println("The card " + cr.getName() + " was not assigned to any set. Adding it to UNKNOWN set... to fix see res/editions/ folder. ");
addCard(new PaperCard(cr, CardEdition.UNKNOWN.getCode(), CardRarity.Special, 1));
}