mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
PlayerControllerHuman: remove gameCache entirely, always ask Game for Card by ID
This commit is contained in:
@@ -96,7 +96,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
private final Localizer localizer = Localizer.getInstance();
|
private final Localizer localizer = Localizer.getInstance();
|
||||||
|
|
||||||
protected Map<SpellAbilityView, SpellAbility> spellViewCache = null;
|
protected Map<SpellAbilityView, SpellAbility> spellViewCache = null;
|
||||||
protected GameEntityViewMap<Card, CardView> gameCache = new GameEntityViewMap<>();
|
|
||||||
|
|
||||||
public PlayerControllerHuman(final Game game0, final Player p, final LobbyPlayer lp) {
|
public PlayerControllerHuman(final Game game0, final Player p, final LobbyPlayer lp) {
|
||||||
super(game0, p, lp);
|
super(game0, p, lp);
|
||||||
@@ -2993,13 +2992,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Card getCard(final CardView cardView) {
|
public Card getCard(final CardView cardView) {
|
||||||
if (gameCache.containsKey(cardView)) {
|
return getGame().findById(cardView.getId());
|
||||||
return gameCache.get(cardView);
|
|
||||||
}
|
|
||||||
|
|
||||||
final Card c = getGame().findById(cardView.getId());
|
|
||||||
gameCache.put(cardView, c);
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CardCollection getCardList(Iterable<CardView> cardViews) {
|
public CardCollection getCardList(Iterable<CardView> cardViews) {
|
||||||
|
|||||||
Reference in New Issue
Block a user