mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Update check
This commit is contained in:
@@ -171,13 +171,13 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
|
|||||||
List<String> missingCards = new ArrayList<>();
|
List<String> missingCards = new ArrayList<>();
|
||||||
CardEdition upcomingSet = null;
|
CardEdition upcomingSet = null;
|
||||||
Date today = new Date();
|
Date today = new Date();
|
||||||
boolean skip = false;
|
List<String> skippedCardName = new ArrayList<>();
|
||||||
|
|
||||||
for (CardEdition e : editions.getOrderedEditions()) {
|
for (CardEdition e : editions.getOrderedEditions()) {
|
||||||
boolean coreOrExpSet = e.getType() == CardEdition.Type.CORE || e.getType() == CardEdition.Type.EXPANSION;
|
boolean coreOrExpSet = e.getType() == CardEdition.Type.CORE || e.getType() == CardEdition.Type.EXPANSION;
|
||||||
boolean isCoreExpSet = coreOrExpSet || e.getType() == CardEdition.Type.REPRINT;
|
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
|
//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) {
|
if (logMissingPerEdition && isCoreExpSet) {
|
||||||
System.out.print(e.getName() + " (" + e.getAllCardsInSet().size() + " cards)");
|
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()) {
|
for (CardEdition.CardInSet cis : e.getAllCardsInSet()) {
|
||||||
CardRules cr = rulesByName.get(cis.name);
|
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;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (cr != null) {
|
if (cr != null) {
|
||||||
addSetCard(e, cis, cr);
|
addSetCard(e, cis, cr);
|
||||||
@@ -226,7 +228,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
|
|||||||
if (!contains(cr.getName())) {
|
if (!contains(cr.getName())) {
|
||||||
if (upcomingSet != null) {
|
if (upcomingSet != null) {
|
||||||
addCard(new PaperCard(cr, upcomingSet.getCode(), CardRarity.Unknown, 1));
|
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. ");
|
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));
|
addCard(new PaperCard(cr, CardEdition.UNKNOWN.getCode(), CardRarity.Special, 1));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user