DeckGenerator started to use card ratings to build more strong decks.

This commit is contained in:
magenoxx 2010-12-05 08:42:15 +00:00
parent f93fd2feeb
commit 50df25489e

View file

@ -139,6 +139,7 @@ public class DeckGenerator {
}
out:
while (nonBasicLandCount < MAX_NON_BASIC_SOURCE) {
boolean found = false;
for (Card card : CardsStorage.getLandCards()) {
int score = 0;
for (Mana mana : card.getMana()) {
@ -149,11 +150,15 @@ public class DeckGenerator {
if (score > 1) {
nonBasicLandCount++;
landCardPool.add(card);
found = true;
}
if (nonBasicLandCount > MAX_NON_BASIC_SOURCE) {
break out;
}
}
if (!found) { //there is no compatible non basic land
break out;
}
}
System.out.println("deck generator card pool: spells=" + spellCardPool.size() + ", lands=" + landCardPool.size());
@ -320,9 +325,11 @@ public class DeckGenerator {
type = 6;
}
this.score = // 5*card.getValue() + // not possible now
// 3*card.getRemoval() + // not possible now
type + getManaCostScore(card, allowedColors);
this.score =
// 5*card.getValue() + // not possible now
3 * CardsStorage.rateCard(card) +
// 3*card.getRemoval() + // not possible now
type + getManaCostScore(card, allowedColors);
}
private int getManaCostScore(Card card, List<ColoredManaSymbol> allowedColors) {