nonLandNames support. updated Conundrum Sphinx

This commit is contained in:
magenoxx 2011-06-08 18:15:38 +04:00
parent 6238e2dfa1
commit 41546cf7d3
2 changed files with 7 additions and 1 deletions

View file

@ -54,6 +54,7 @@ public class Sets extends HashMap<String, ExpansionSet> {
private final static Logger logger = Logger.getLogger(Sets.class);
private static final Sets fINSTANCE = new Sets();
private static Set<String> names;
private static Set<String> nonLandNames;
private static List<Card> cards;
protected static Random rnd = new Random();
@ -63,6 +64,7 @@ public class Sets extends HashMap<String, ExpansionSet> {
private Sets() {
names = new TreeSet<String>();
nonLandNames = new TreeSet<String>();
cards = new ArrayList<Card>();
this.addSet(AlaraReborn.getInstance());
this.addSet(Apocalypse.getInstance());
@ -95,6 +97,7 @@ public class Sets extends HashMap<String, ExpansionSet> {
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<String, ExpansionSet> {
return names;
}
public static Set<String> getNonLandCardNames() {
return nonLandNames;
}
public static Card getRandomCard() {
return cards.get(rnd.nextInt(cards.size()));
}

View file

@ -90,7 +90,6 @@ class ConundrumSphinxEffect extends OneShotEffect<ConundrumSphinxEffect> {
@Override
public boolean apply(Game game, Ability source) {
Set<String> cardNames = Sets.getCardNames();
Choice cardChoice = new ChoiceImpl();
cardChoice.setChoices(Sets.getCardNames());
for (Player player: game.getPlayers().values()) {