mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Improved sideboard generation in card-based decks
This commit is contained in:
@@ -22,6 +22,7 @@ import forge.model.FModel;
|
|||||||
import forge.util.MyRandom;
|
import forge.util.MyRandom;
|
||||||
import forge.util.PredicateString;
|
import forge.util.PredicateString;
|
||||||
|
|
||||||
|
import java.awt.print.Paper;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -238,11 +239,23 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
|
|||||||
System.out.println("Post Size fix : " + deckList.size());
|
System.out.println("Post Size fix : " + deckList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Create Deck
|
||||||
final Deck result = new Deck(generateName());
|
final Deck result = new Deck(generateName());
|
||||||
result.getMain().add(deckList);
|
result.getMain().add(deckList);
|
||||||
|
|
||||||
|
//Add remaining non-land colour matching cards to sideboard
|
||||||
final CardPool cp = result.getOrCreate(DeckSection.Sideboard);
|
final CardPool cp = result.getOrCreate(DeckSection.Sideboard);
|
||||||
cp.add(aiPlayables);
|
Iterable<PaperCard> potentialSideboard = Iterables.filter(aiPlayables,
|
||||||
cp.add(availableList);
|
Predicates.and(Predicates.compose(hasColor, PaperCard.FN_GET_RULES),
|
||||||
|
Predicates.compose(CardRulesPredicates.Presets.IS_NON_LAND, PaperCard.FN_GET_RULES)));
|
||||||
|
int i=0;
|
||||||
|
while(i<15 && potentialSideboard.iterator().hasNext()){
|
||||||
|
PaperCard sbCard = potentialSideboard.iterator().next();
|
||||||
|
cp.add(sbCard);
|
||||||
|
aiPlayables.remove(sbCard);
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
if (logToConsole) {
|
if (logToConsole) {
|
||||||
debugFinalDeck();
|
debugFinalDeck();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user