From 50df25489e04d54de200f0bb8658c9b3d8e05017 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 5 Dec 2010 08:42:15 +0000 Subject: [PATCH] DeckGenerator started to use card ratings to build more strong decks. --- .../mage/client/deck/generator/DeckGenerator.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java index dedcc1ff720..5910ff41512 100644 --- a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java +++ b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java @@ -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 allowedColors) {