Fixed card-based deck generation where extra colours were kept despite no cards of that colour being included.

This commit is contained in:
austinio7116
2018-03-03 10:53:57 +00:00
committed by maustin
parent e0882ab6b5
commit 73a623cc1b
2 changed files with 19 additions and 0 deletions

View File

@@ -62,6 +62,10 @@ public class CardThemedCommanderDeckBuilder extends CardThemedDeckBuilder {
//do nothing as we cannot add extra colours beyond commanders //do nothing as we cannot add extra colours beyond commanders
} }
@Override
protected void updateColors(){
//do nothing as we cannot deviate from commander colours
}
/** /**
* Generate a descriptive name. * Generate a descriptive name.
* *

View File

@@ -133,6 +133,19 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
return buildDeck().getMain(); return buildDeck().getMain();
} }
protected void updateColors(){
//update colors
FullDeckColors finalDeckColors = new FullDeckColors();
for(PaperCard c:deckList){
if(finalDeckColors.canChoseMoreColors()){
finalDeckColors.addColorsOf(c);
}
}
colors = finalDeckColors.getChosenColors();
if (logColorsToConsole) {
System.out.println("Final Colors: " + colors.toEnumSet().toString());
}
}
/** /**
* <p> * <p>
* buildDeck. * buildDeck.
@@ -223,6 +236,8 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
System.out.println("Post Randoms : " + deckList.size()); System.out.println("Post Randoms : " + deckList.size());
} }
updateColors();
addLandKeyCards(); addLandKeyCards();
List<String> duals = getDualLandList(); List<String> duals = getDualLandList();