Card: update Type, color and keywords of the view if they have changed on StateChange

This commit is contained in:
Hanmac
2016-07-06 11:22:59 +00:00
parent 637306b991
commit 641e4cba68

View File

@@ -359,6 +359,17 @@ public class Card extends GameEntity implements Comparable<Card> {
final Game game = getGame();
if (game != null) {
// update Type, color and keywords again if they have changed
if (!changedCardTypes.isEmpty()) {
currentState.getView().updateType(currentState);
}
if (!changedCardColors.isEmpty()) {
currentState.getView().updateColors(this);
}
if (!changedCardKeywords.isEmpty()) {
currentState.getView().updateKeywords(this, currentState);
}
if (state == CardStateName.FaceDown) {
view.updateHiddenId(game.nextHiddenCardId());
}