| 43 | |
| 44 | |
| 45 | public class GameFormat implements Comparable<GameFormat> { |
| 46 | private final String name; |
| 47 | public enum FormatType { |
| 48 | SANCTIONED, |
| 49 | CASUAL, |
| 50 | ARCHIVED, |
| 51 | DIGITAL, |
| 52 | CUSTOM |
| 53 | } |
| 54 | public enum FormatSubType { |
| 55 | BLOCK, |
| 56 | STANDARD, |
| 57 | EXTENDED, |
| 58 | PAUPER, |
| 59 | PIONEER, |
| 60 | MODERN, |
| 61 | LEGACY, |
| 62 | VINTAGE, |
| 63 | COMMANDER, |
| 64 | PLANECHASE, |
| 65 | VIDEOGAME, |
| 66 | MTGO, |
| 67 | ARENA, |
| 68 | CUSTOM |
| 69 | } |
| 70 | |
| 71 | // contains allowed sets, when empty allows all sets |
| 72 | private FormatType formatType; |
| 73 | private FormatSubType formatSubType; |
| 74 | |
| 75 | protected final List<String> allowedSetCodes; // this is mutable to support quest mode set unlocks |
| 76 | protected final List<CardRarity> allowedRarities; |
| 77 | protected final List<String> bannedCardNames; |
| 78 | protected final List<String> restrictedCardNames; |
| 79 | protected final List<String> additionalCardNames; // for cards that are legal but not reprinted in any of the allowed Sets |
| 80 | protected boolean restrictedLegendary = false; |
| 81 | private Date effectiveDate; |
| 82 | private final static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| 83 | private final static String DEFAULTDATE = "1990-01-01"; |
| 84 | |
| 85 | protected final transient List<String> allowedSetCodes_ro; |
| 86 | protected final transient List<String> bannedCardNames_ro; |
| 87 | protected final transient List<String> restrictedCardNames_ro; |
| 88 | protected final transient List<String> additionalCardNames_ro; |
| 89 | |
| 90 | protected final transient Predicate<PaperCard> filterRules; |
| 91 | protected final transient Predicate<PaperCard> filterPrinted; |
| 92 | |
| 93 | private final int index; |
| 94 | |
| 95 | public GameFormat(final String fName, final Iterable<String> sets, final List<String> bannedCards) { |
| 96 | this(fName, parseDate(DEFAULTDATE), sets, bannedCards, null, false, null, null, 0, FormatType.CUSTOM, FormatSubType.CUSTOM); |
| 97 | } |
| 98 | |
| 99 | public static final GameFormat NoFormat = new GameFormat("(none)", parseDate(DEFAULTDATE) , null, null, null, false |
| 100 | , null, null, Integer.MAX_VALUE, FormatType.CUSTOM, FormatSubType.CUSTOM); |
| 101 | |
| 102 | public GameFormat(final String fName, final Date effectiveDate, final Iterable<String> sets, final List<String> bannedCards, |
nothing calls this directly
no test coverage detected