PlayerControllerHuman: remove gameCache entirely, always ask Game for Card by ID

This commit is contained in:
Hans Mackowiak
2020-05-26 23:21:44 +02:00
parent 5c7a0adf33
commit 815b2bc4aa

View File

@@ -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) {