mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Card: update Type, color and keywords of the view if they have changed on StateChange
This commit is contained in:
@@ -359,6 +359,17 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
final Game game = getGame();
|
final Game game = getGame();
|
||||||
if (game != null) {
|
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) {
|
if (state == CardStateName.FaceDown) {
|
||||||
view.updateHiddenId(game.nextHiddenCardId());
|
view.updateHiddenId(game.nextHiddenCardId());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user