Improved snow land decision making on LDA deck generator

This commit is contained in:
austinio7116
2021-04-11 16:06:53 +01:00
parent 1c1d743638
commit 950e51e0fe
2 changed files with 2 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ public class ArchetypeDeckBuilder extends CardThemedDeckBuilder{
archetype = archetype0; archetype = archetype0;
for(Pair<String, Double> pair : archetype.getCardProbabilities()){ for(Pair<String, Double> pair : archetype.getCardProbabilities()){
for(int i=0;i<5;++i){ for(int i=0;i<5;++i){
if (pair.getLeft().equals(MagicColor.Constant.SNOW_LANDS.get(i))) { if (pair.getLeft().equals(MagicColor.Constant.SNOW_LANDS.get(i)) && pair.getRight() > 0.04) {
needsSnowLands=true; needsSnowLands=true;
return; return;
} }

View File

@@ -704,24 +704,11 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
System.out.printf("Basics[%s]: %d/%d = %f%% = %d cards%n", MagicColor.Constant.BASIC_LANDS.get(i), clrCnts[i], totalColor, 100*p, nLand + 1); System.out.printf("Basics[%s]: %d/%d = %f%% = %d cards%n", MagicColor.Constant.BASIC_LANDS.get(i), clrCnts[i], totalColor, 100*p, nLand + 1);
} }
PaperCard snowLand = null;
// if appropriate snow-covered lands are available, add them
for (final PaperCard cp : basicLands) {
if (cp.getName().equals(MagicColor.Constant.SNOW_LANDS.get(i))) {
snowLand = cp;
break;
}
}
for (int j = 0; j < nLand; j++) { for (int j = 0; j < nLand; j++) {
if(snowLand!=null){
deckList.add(snowLand);
}else {
deckList.add(getBasicLand(i)); deckList.add(getBasicLand(i));
} }
} }
} }
}
// A common problem at this point is that p in the above loop was exactly 1/2, // A common problem at this point is that p in the above loop was exactly 1/2,
// and nLand rounded up for both colors, so that one too many lands was added. // and nLand rounded up for both colors, so that one too many lands was added.