From 41546cf7d39136db25c2e34b2f34b6a6bf5b14be Mon Sep 17 00:00:00 2001 From: magenoxx Date: Wed, 8 Jun 2011 18:15:38 +0400 Subject: [PATCH] nonLandNames support. updated Conundrum Sphinx --- Mage.Sets/src/mage/sets/Sets.java | 7 +++++++ Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/Sets.java b/Mage.Sets/src/mage/sets/Sets.java index 8a3fad9dba..8b80ce2f1a 100644 --- a/Mage.Sets/src/mage/sets/Sets.java +++ b/Mage.Sets/src/mage/sets/Sets.java @@ -54,6 +54,7 @@ public class Sets extends HashMap { private final static Logger logger = Logger.getLogger(Sets.class); private static final Sets fINSTANCE = new Sets(); private static Set names; + private static Set nonLandNames; private static List cards; protected static Random rnd = new Random(); @@ -63,6 +64,7 @@ public class Sets extends HashMap { private Sets() { names = new TreeSet(); + nonLandNames = new TreeSet(); cards = new ArrayList(); this.addSet(AlaraReborn.getInstance()); this.addSet(Apocalypse.getInstance()); @@ -95,6 +97,7 @@ public class Sets extends HashMap { for (Card card: set.getCards()) { cards.add(card); names.add(card.getName()); + if (!card.getCardType().contains(CardType.LAND)) nonLandNames.add(card.getName()); } } @@ -102,6 +105,10 @@ public class Sets extends HashMap { return names; } + public static Set getNonLandCardNames() { + return nonLandNames; + } + public static Card getRandomCard() { return cards.get(rnd.nextInt(cards.size())); } diff --git a/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java b/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java index 58e18d3988..8e610581dd 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java +++ b/Mage.Sets/src/mage/sets/magic2011/ConundrumSphinx.java @@ -90,7 +90,6 @@ class ConundrumSphinxEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Set cardNames = Sets.getCardNames(); Choice cardChoice = new ChoiceImpl(); cardChoice.setChoices(Sets.getCardNames()); for (Player player: game.getPlayers().values()) {