mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18: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();
|
||||
|
||||
protected Map<SpellAbilityView, SpellAbility> spellViewCache = null;
|
||||
protected GameEntityViewMap<Card, CardView> gameCache = new GameEntityViewMap<>();
|
||||
|
||||
public PlayerControllerHuman(final Game game0, final Player p, final LobbyPlayer lp) {
|
||||
super(game0, p, lp);
|
||||
@@ -2993,13 +2992,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
}
|
||||
|
||||
public Card getCard(final CardView cardView) {
|
||||
if (gameCache.containsKey(cardView)) {
|
||||
return gameCache.get(cardView);
|
||||
}
|
||||
|
||||
final Card c = getGame().findById(cardView.getId());
|
||||
gameCache.put(cardView, c);
|
||||
return c;
|
||||
return getGame().findById(cardView.getId());
|
||||
}
|
||||
|
||||
public CardCollection getCardList(Iterable<CardView> cardViews) {
|
||||
|
||||
Reference in New Issue
Block a user