mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Added set code validation check to gameformat parser
This commit is contained in:
@@ -74,7 +74,22 @@ public class GameFormat implements Comparable<GameFormat> {
|
|||||||
this.index = compareIdx;
|
this.index = compareIdx;
|
||||||
this.formatType = formatType;
|
this.formatType = formatType;
|
||||||
this.name = fName;
|
this.name = fName;
|
||||||
allowedSetCodes = sets == null ? new ArrayList<String>() : Lists.newArrayList(sets);
|
|
||||||
|
if(sets != null) {
|
||||||
|
Set<String> parsedSets = new HashSet<>();
|
||||||
|
for (String set : sets) {
|
||||||
|
if (StaticData.instance().getEditions().get(set) == null) {
|
||||||
|
System.out.println("Set " + set + " in format " + fName + " does not match any valid editions!");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
parsedSets.add(set);
|
||||||
|
|
||||||
|
}
|
||||||
|
allowedSetCodes = Lists.newArrayList(parsedSets);
|
||||||
|
}else{
|
||||||
|
allowedSetCodes = new ArrayList<String>();
|
||||||
|
}
|
||||||
|
|
||||||
bannedCardNames = bannedCards == null ? new ArrayList<String>() : Lists.newArrayList(bannedCards);
|
bannedCardNames = bannedCards == null ? new ArrayList<String>() : Lists.newArrayList(bannedCards);
|
||||||
restrictedCardNames = restrictedCards == null ? new ArrayList<String>() : Lists.newArrayList(restrictedCards);
|
restrictedCardNames = restrictedCards == null ? new ArrayList<String>() : Lists.newArrayList(restrictedCards);
|
||||||
allowedRarities = rarities == null ? Lists.newArrayList() : rarities;
|
allowedRarities = rarities == null ? Lists.newArrayList() : rarities;
|
||||||
|
|||||||
Reference in New Issue
Block a user