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

View File

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

View File

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