Fixed DeckGenerator that included rated cards that didn't fit chosen colors.

This commit is contained in:
magenoxx 2010-12-09 09:08:09 +00:00
parent b2d9c3b344
commit 168c8dc294

View file

@ -346,7 +346,7 @@ public class DeckGenerator {
} }
} }
if (count == 0) { if (count == 0) {
return -10; return -30;
} }
Integer typeCount = singleCount.get(symbol); Integer typeCount = singleCount.get(symbol);
if (typeCount == null) { if (typeCount == null) {
@ -378,7 +378,7 @@ public class DeckGenerator {
} }
public static void main(String[] args) { public static void main(String[] args) {
/*for (Card card : CardsStorage.getAllCards()) { for (Card card : CardsStorage.getAllCards()) {
System.out.println(card.getName()); System.out.println(card.getName());
System.out.print(" "); System.out.print(" ");
for (String symbol : card.getManaCost().getSymbols()) { for (String symbol : card.getManaCost().getSymbols()) {
@ -387,16 +387,16 @@ public class DeckGenerator {
} }
System.out.println(CardUtil.isBasicLand(card)); System.out.println(CardUtil.isBasicLand(card));
List<ColoredManaSymbol> allowedColors = new ArrayList<ColoredManaSymbol>(); List<ColoredManaSymbol> allowedColors = new ArrayList<ColoredManaSymbol>();
allowedColors.add(ColoredManaSymbol.lookup('W')); allowedColors.add(ColoredManaSymbol.lookup('B'));
allowedColors.add(ColoredManaSymbol.lookup('G')); allowedColors.add(ColoredManaSymbol.lookup('G'));
DeckGenerator.MageScoredCard m = new DeckGenerator.MageScoredCard(card, allowedColors); DeckGenerator.MageScoredCard m = new DeckGenerator.MageScoredCard(card, allowedColors);
System.out.println(); System.out.println();
System.out.println(" score: " + m.getScore()); System.out.println(" score: " + m.getScore());
System.out.println(); System.out.println();
}*/ }
System.out.println("Done! Path: " + generateDeck()); //System.out.println("Done! Path: " + generateDeck());
} }
} }