mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
try to fix ConcurrentModificationException on FCollection -> addAll
cause: tapped.addAll(tappedForMana) on AiCardMemory
This commit is contained in:
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
package forge.ai;
|
package forge.ai;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -79,21 +79,21 @@ public class AiCardMemory {
|
|||||||
private final Set<Card> memRevealedCards;
|
private final Set<Card> memRevealedCards;
|
||||||
|
|
||||||
public AiCardMemory() {
|
public AiCardMemory() {
|
||||||
this.memMandatoryAttackers = new HashSet<>();
|
this.memMandatoryAttackers = ConcurrentHashMap.newKeySet();
|
||||||
this.memHeldManaSources = new HashSet<>();
|
this.memHeldManaSources = ConcurrentHashMap.newKeySet();
|
||||||
this.memHeldManaSourcesForCombat = new HashSet<>();
|
this.memHeldManaSourcesForCombat = ConcurrentHashMap.newKeySet();
|
||||||
this.memHeldManaSourcesForEnemyCombat = new HashSet<>();
|
this.memHeldManaSourcesForEnemyCombat = ConcurrentHashMap.newKeySet();
|
||||||
this.memAttachedThisTurn = new HashSet<>();
|
this.memAttachedThisTurn = ConcurrentHashMap.newKeySet();
|
||||||
this.memAnimatedThisTurn = new HashSet<>();
|
this.memAnimatedThisTurn = ConcurrentHashMap.newKeySet();
|
||||||
this.memBouncedThisTurn = new HashSet<>();
|
this.memBouncedThisTurn = ConcurrentHashMap.newKeySet();
|
||||||
this.memActivatedThisTurn = new HashSet<>();
|
this.memActivatedThisTurn = ConcurrentHashMap.newKeySet();
|
||||||
this.memTrickAttackers = new HashSet<>();
|
this.memTrickAttackers = ConcurrentHashMap.newKeySet();
|
||||||
this.memChosenFogEffect = new HashSet<>();
|
this.memChosenFogEffect = ConcurrentHashMap.newKeySet();
|
||||||
this.memMarkedToAvoidReentry = new HashSet<>();
|
this.memMarkedToAvoidReentry = ConcurrentHashMap.newKeySet();
|
||||||
this.memHeldManaSourcesForNextSpell = new HashSet<>();
|
this.memHeldManaSourcesForNextSpell = ConcurrentHashMap.newKeySet();
|
||||||
this.memPaysTapCost = new HashSet<>();
|
this.memPaysTapCost = ConcurrentHashMap.newKeySet();
|
||||||
this.memPaysSacCost = new HashSet<>();
|
this.memPaysSacCost = ConcurrentHashMap.newKeySet();
|
||||||
this.memRevealedCards = new HashSet<>();
|
this.memRevealedCards = ConcurrentHashMap.newKeySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Card> getMemorySet(MemorySet set) {
|
private Set<Card> getMemorySet(MemorySet set) {
|
||||||
|
|||||||
Reference in New Issue
Block a user