mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Fix ConcurrentModificationException
This commit is contained in:
@@ -319,17 +319,13 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
|
|||||||
|
|
||||||
//Add remaining non-land colour matching cards to sideboard
|
//Add remaining non-land colour matching cards to sideboard
|
||||||
final CardPool cp = result.getOrCreate(DeckSection.Sideboard);
|
final CardPool cp = result.getOrCreate(DeckSection.Sideboard);
|
||||||
Iterator<PaperCard> potentialSideboard = aiPlayables.stream()
|
List<PaperCard> sideboard = aiPlayables.stream()
|
||||||
.filter(PaperCardPredicates.fromRules(hasColor.and(CardRulesPredicates.IS_NON_LAND))).iterator();
|
.filter(PaperCardPredicates.fromRules(hasColor.and(CardRulesPredicates.IS_NON_LAND)))
|
||||||
int i=0;
|
.limit(15)
|
||||||
while(i<15 && potentialSideboard.hasNext()){
|
.collect(Collectors.toList());
|
||||||
PaperCard sbCard = potentialSideboard.next();
|
cp.addAllFlat(sideboard);
|
||||||
cp.add(sbCard);
|
aiPlayables.removeAll(sideboard);
|
||||||
aiPlayables.remove(sbCard);
|
rankedColorList.removeAll(sideboard);
|
||||||
rankedColorList.remove(sbCard);
|
|
||||||
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
if (logToConsole) {
|
if (logToConsole) {
|
||||||
debugFinalDeck();
|
debugFinalDeck();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user