- Add Conspiracy section to the constructed deck editor for convenience (really needs to be added to the draft deck editor)

This commit is contained in:
Sol
2014-08-07 02:45:21 +00:00
parent 9b35413ded
commit fd799d679d
3 changed files with 9 additions and 2 deletions

View File

@@ -511,6 +511,7 @@ public final class CardRulesPredicates {
public static final Predicate<CardRules> IS_PLANE_OR_PHENOMENON = Predicates.or(IS_PLANE, IS_PHENOMENON);
public static final Predicate<CardRules> IS_SCHEME = CardRulesPredicates.coreType(true, CardType.CoreType.Scheme);
public static final Predicate<CardRules> IS_VANGUARD = CardRulesPredicates.coreType(true, CardType.CoreType.Vanguard);
public static final Predicate<CardRules> IS_CONSPIRACY = CardRulesPredicates.coreType(true, CardType.CoreType.Conspiracy);
public static final Predicate<CardRules> IS_NON_LAND = CardRulesPredicates.coreType(false, CardType.CoreType.Land);
public static final Predicate<CardRules> IS_NON_CREATURE_SPELL = Predicates.not(Predicates.or(Presets.IS_CREATURE, Presets.IS_LAND));
public static final Predicate<CardRules> CAN_BE_COMMANDER = Predicates.or(CardRulesPredicates.rules(StringOp.CONTAINS_IC, "can be your commander"),

View File

@@ -50,7 +50,7 @@ import java.util.Map.Entry;
public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
private final DeckController<Deck> controller;
private final List<DeckSection> allSections = new ArrayList<DeckSection>();
private final ItemPool<PaperCard> normalPool, avatarPool, planePool, schemePool;
private final ItemPool<PaperCard> normalPool, avatarPool, planePool, schemePool, conspiracyPool;
//=========== Constructor
/**
@@ -66,11 +66,13 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
allSections.add(DeckSection.Avatar);
allSections.add(DeckSection.Schemes);
allSections.add(DeckSection.Planes);
allSections.add(DeckSection.Conspiracy);
normalPool = ItemPool.createFrom(FModel.getMagicDb().getCommonCards().getAllCards(), PaperCard.class);
avatarPool = ItemPool.createFrom(FModel.getMagicDb().getVariantCards().getAllCards(Predicates.compose(CardRulesPredicates.Presets.IS_VANGUARD, PaperCard.FN_GET_RULES)), PaperCard.class);
planePool = ItemPool.createFrom(FModel.getMagicDb().getVariantCards().getAllCards(Predicates.compose(CardRulesPredicates.Presets.IS_PLANE_OR_PHENOMENON, PaperCard.FN_GET_RULES)), PaperCard.class);
schemePool = ItemPool.createFrom(FModel.getMagicDb().getVariantCards().getAllCards(Predicates.compose(CardRulesPredicates.Presets.IS_SCHEME, PaperCard.FN_GET_RULES)), PaperCard.class);
conspiracyPool = ItemPool.createFrom(FModel.getMagicDb().getVariantCards().getAllCards(Predicates.compose(CardRulesPredicates.Presets.IS_CONSPIRACY, PaperCard.FN_GET_RULES)), PaperCard.class);
CardManager catalogManager = new CardManager(false); // TODO: restore the functionality of the "want uniques only" toggle
CardManager deckManager = new CardManager(false); // IMPORTANT: must *always* show all cards in the deck, otherwise cards with different art get ignored!
@@ -310,7 +312,9 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
case Commander:
break; //do nothing for Commander here
case Conspiracy:
break; //do nothing for conspiracy here
this.getCatalogManager().setup(ItemManagerConfig.CONSPIRACY_DECKS);
this.getCatalogManager().setPool(conspiracyPool,true);
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Conspiracy));
}
this.controller.updateCaptions();

View File

@@ -46,6 +46,8 @@ public enum ItemManagerConfig {
null, null, 4, 0),
SCHEME_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, true,
null, null, 4, 0),
CONSPIRACY_DECKS(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, true,
null, null, 4, 0),
SCHEME_DECK_EDITOR(SColumnUtil.getCatalogDefaultColumns(true), true, false, true,
null, null, 4, 0),
PLANAR_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, true,