Updating all enum FormatSubType to UPPERCASE as constants

This commit is contained in:
leriomaggio
2021-07-04 17:46:07 +01:00
parent 9c72cf2eb4
commit 33526bb31b
3 changed files with 26 additions and 26 deletions

View File

@@ -65,19 +65,19 @@ public class GameFormat implements Comparable<GameFormat> {
CUSTOM
}
public enum FormatSubType {
Block,
Standard,
Extended,
Pioneer,
Modern,
Legacy,
Vintage,
Commander,
Planechase,
Videogame,
BLOCK,
STANDARD,
EXTENDED,
PIONEER,
MODERN,
LEGACY,
VINTAGE,
COMMANDER,
PLANECHASE,
VIDEOGAME,
MTGO,
Arena,
Custom
ARENA,
CUSTOM
}
// contains allowed sets, when empty allows all sets
@@ -105,11 +105,11 @@ public class GameFormat implements Comparable<GameFormat> {
private final int index;
public GameFormat(final String fName, final Iterable<String> sets, final List<String> bannedCards) {
this(fName, parseDate(DEFAULTDATE), sets, bannedCards, null, false, null, null, 0, FormatType.CUSTOM, FormatSubType.Custom);
this(fName, parseDate(DEFAULTDATE), sets, bannedCards, null, false, null, null, 0, FormatType.CUSTOM, FormatSubType.CUSTOM);
}
public static final GameFormat NoFormat = new GameFormat("(none)", parseDate(DEFAULTDATE) , null, null, null, false
, null, null, Integer.MAX_VALUE, FormatType.CUSTOM, FormatSubType.Custom);
, null, null, Integer.MAX_VALUE, FormatType.CUSTOM, FormatSubType.CUSTOM);
public GameFormat(final String fName, final Date effectiveDate, final Iterable<String> sets, final List<String> bannedCards,
final List<String> restrictedCards, Boolean restrictedLegendary, final List<String> additionalCards,
@@ -366,7 +366,7 @@ public class GameFormat implements Comparable<GameFormat> {
try {
formatsubType = FormatSubType.valueOf(section.get("subtype"));
} catch (Exception e) {
formatsubType = FormatSubType.Custom;
formatsubType = FormatSubType.CUSTOM;
}
Integer idx = section.getInt("order");
String dateStr = section.get("effective");
@@ -552,7 +552,7 @@ public class GameFormat implements Comparable<GameFormat> {
//exclude Digital formats from lists for now
continue;
}
if (gf.getFormatSubType().equals(FormatSubType.Commander)){
if (gf.getFormatSubType().equals(FormatSubType.COMMANDER)){
//exclude Commander format as other deck checks are not performed here
continue;
}

View File

@@ -27,9 +27,9 @@ public class HistoricFormatSelect extends FScreen {
private GameFormat selectedFormat;
private final FGroupList<GameFormat> lstFormats = add(new FGroupList<>());
private final Set<GameFormat.FormatSubType> historicSubTypes = new HashSet<>(Arrays.asList(GameFormat.FormatSubType.Block,
GameFormat.FormatSubType.Standard,GameFormat.FormatSubType.Extended,GameFormat.FormatSubType.Modern,
GameFormat.FormatSubType.Legacy, GameFormat.FormatSubType.Vintage));
private final Set<GameFormat.FormatSubType> historicSubTypes = new HashSet<>(Arrays.asList(GameFormat.FormatSubType.BLOCK,
GameFormat.FormatSubType.STANDARD,GameFormat.FormatSubType.EXTENDED,GameFormat.FormatSubType.MODERN,
GameFormat.FormatSubType.LEGACY, GameFormat.FormatSubType.VINTAGE));
private Runnable onCloseCallBack;
@@ -56,22 +56,22 @@ public class HistoricFormatSelect extends FScreen {
break;
case HISTORIC:
switch (format.getFormatSubType()){
case Block:
case BLOCK:
lstFormats.addItem(format, 2);
break;
case Standard:
case STANDARD:
lstFormats.addItem(format, 3);
break;
case Extended:
case EXTENDED:
lstFormats.addItem(format, 4);
break;
case Modern:
case MODERN:
lstFormats.addItem(format, 5);
break;
case Legacy:
case LEGACY:
lstFormats.addItem(format, 6);
break;
case Vintage:
case VINTAGE:
lstFormats.addItem(format, 7);
break;

View File

@@ -64,7 +64,7 @@ public final class GameFormatQuest extends GameFormat {
public GameFormatQuest(final GameFormat toCopy, boolean allowSetUnlocks) {
super(toCopy.getName(), toCopy.getEffectiveDate(), toCopy.getAllowedSetCodes(), toCopy.getBannedCardNames(), toCopy.getRestrictedCards(),
toCopy.isRestrictedLegendary(),toCopy.getAdditionalCards(), toCopy.getAllowedRarities(),
toCopy.getIndex(), FormatType.CUSTOM, FormatSubType.Custom);
toCopy.getIndex(), FormatType.CUSTOM, FormatSubType.CUSTOM);
allowUnlocks = allowSetUnlocks;
}