Support parsing out plane cards associated with each ConquestPlane

This commit is contained in:
drdev
2015-12-05 01:18:58 +00:00
parent 3488068249
commit 4fee776106

View File

@@ -183,6 +183,7 @@ public enum ConquestPlane {
private final FCollection<Region> regions; private final FCollection<Region> regions;
private final FCollection<String> bannedCards = new FCollection<String>(); private final FCollection<String> bannedCards = new FCollection<String>();
private final DeckGenPool cardPool = new DeckGenPool(); private final DeckGenPool cardPool = new DeckGenPool();
private final FCollection<PaperCard> planeCards = new FCollection<PaperCard>();
private final FCollection<PaperCard> commanders = new FCollection<PaperCard>(); private final FCollection<PaperCard> commanders = new FCollection<PaperCard>();
private ConquestPlane(String name0, String[] setCodes0, Region[] regions0) { private ConquestPlane(String name0, String[] setCodes0, Region[] regions0) {
@@ -237,6 +238,23 @@ public enum ConquestPlane {
} }
} }
static {
for (PaperCard pc : FModel.getMagicDb().getVariantCards().getAllCards()) {
CardType type = pc.getRules().getType();
if (type.isPlane()) {
for (String subtype : type.getSubtypes()) {
try {
ConquestPlane plane = ConquestPlane.valueOf(subtype);
if (plane != null) {
plane.planeCards.add(pc);
}
}
catch (Exception ex) {} //suppress exception
}
}
}
}
public String getName() { public String getName() {
return name; return name;
} }
@@ -270,8 +288,7 @@ public enum ConquestPlane {
public static final int COLS_PER_REGION = 3; public static final int COLS_PER_REGION = 3;
public static final int PORTAL_COL = (COLS_PER_REGION - 1) / 2; public static final int PORTAL_COL = (COLS_PER_REGION - 1) / 2;
private final String name; private final String name, artCardName;
private final String artCardName;
private final ColorSet colorSet; private final ColorSet colorSet;
private final Predicate<PaperCard> pred; private final Predicate<PaperCard> pred;
private final DeckGenPool cardPool = new DeckGenPool(); private final DeckGenPool cardPool = new DeckGenPool();