mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Updates with new renamed CardArtPreference options in CardDb
This commit is contained in:
@@ -17,18 +17,17 @@
|
|||||||
*/
|
*/
|
||||||
package forge.deck;
|
package forge.deck;
|
||||||
|
|
||||||
|
import forge.card.CardDb;
|
||||||
|
import forge.card.CardDb.CardArtPreference;
|
||||||
|
import forge.card.ICardDatabase;
|
||||||
|
import forge.item.PaperCard;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import forge.card.CardDb;
|
|
||||||
import forge.card.CardDb.SetPreference;
|
|
||||||
import forge.card.ICardDatabase;
|
|
||||||
import forge.item.PaperCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* DeckRecognizer class.
|
* DeckRecognizer class.
|
||||||
@@ -105,7 +104,7 @@ public class DeckRecognizer {
|
|||||||
//private static final Pattern READ_SEPARATED_EDITION = Pattern.compile("[[\\(\\{]([a-zA-Z0-9]){1,3})[]*\\s+(.*)");
|
//private static final Pattern READ_SEPARATED_EDITION = Pattern.compile("[[\\(\\{]([a-zA-Z0-9]){1,3})[]*\\s+(.*)");
|
||||||
private static final Pattern SEARCH_SINGLE_SLASH = Pattern.compile("(?<=[^/])\\s*/\\s*(?=[^/])");
|
private static final Pattern SEARCH_SINGLE_SLASH = Pattern.compile("(?<=[^/])\\s*/\\s*(?=[^/])");
|
||||||
|
|
||||||
private final SetPreference useLastSet;
|
private final CardArtPreference useLastSet;
|
||||||
private final ICardDatabase db;
|
private final ICardDatabase db;
|
||||||
private Date recognizeCardsPrintedBefore = null;
|
private Date recognizeCardsPrintedBefore = null;
|
||||||
|
|
||||||
@@ -114,10 +113,10 @@ public class DeckRecognizer {
|
|||||||
useLastSet = null;
|
useLastSet = null;
|
||||||
}
|
}
|
||||||
else if (onlyCoreAndExp) {
|
else if (onlyCoreAndExp) {
|
||||||
useLastSet = SetPreference.LatestCoreExp;
|
useLastSet = CardArtPreference.LatestPrintNoPromoNoOnline;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
useLastSet = SetPreference.Latest;
|
useLastSet = CardArtPreference.LatestPrint;
|
||||||
}
|
}
|
||||||
this.db = db;
|
this.db = db;
|
||||||
}
|
}
|
||||||
@@ -156,7 +155,7 @@ public class DeckRecognizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private PaperCard tryGetCard(String text) {
|
private PaperCard tryGetCard(String text) {
|
||||||
return db.getCardFromEdition(text, recognizeCardsPrintedBefore, useLastSet);
|
return db.getCardFromEditions(text, useLastSet, recognizeCardsPrintedBefore);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Token recognizePossibleNameAndNumber(final String name, final int n) {
|
private Token recognizePossibleNameAndNumber(final String name, final int n) {
|
||||||
|
|||||||
Reference in New Issue
Block a user