mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
added option to use only core and expansion sets in deck importer, fixed a related bug
This commit is contained in:
@@ -221,7 +221,7 @@ public final class CardDb implements ICardDatabase {
|
||||
|
||||
@Override
|
||||
public PaperCard getCardFromEdition(final String cardName, final Date printedBefore, final SetPreference fromSet) {
|
||||
return getCardFromEdition(cardName, null, fromSet, -1);
|
||||
return getCardFromEdition(cardName, printedBefore, fromSet, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -164,12 +164,18 @@ public class DeckRecognizer {
|
||||
//private static final Pattern READ_SEPARATED_EDITION = Pattern.compile("[[\\(\\{]([a-zA-Z0-9]){1,3})[]*\\s+(.*)");
|
||||
|
||||
|
||||
private final boolean useLastSet;
|
||||
private final SetPreference useLastSet;
|
||||
private final ICardDatabase db;
|
||||
private Date recognizeCardsPrintedBefore = null;
|
||||
|
||||
public DeckRecognizer(boolean fromLatestSet, CardDb db) {
|
||||
useLastSet = fromLatestSet;
|
||||
public DeckRecognizer(boolean fromLatestSet, boolean onlyCoreAndExp, CardDb db) {
|
||||
if(!fromLatestSet)
|
||||
useLastSet = null;
|
||||
else if (onlyCoreAndExp)
|
||||
useLastSet = SetPreference.LatestCoreExp;
|
||||
else
|
||||
useLastSet = SetPreference.Latest;
|
||||
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
@@ -203,7 +209,7 @@ public class DeckRecognizer {
|
||||
}
|
||||
|
||||
private PaperCard tryGetCard(String text) {
|
||||
return db.getCardFromEdition(text, recognizeCardsPrintedBefore, useLastSet ? SetPreference.Latest : null);
|
||||
return db.getCardFromEdition(text, recognizeCardsPrintedBefore, useLastSet);
|
||||
}
|
||||
|
||||
private Token recognizePossibleNameAndNumber(final String name, final int n) {
|
||||
|
||||
Reference in New Issue
Block a user