From ff62cd9f40dc43d982cf44332960a1ec22934622 Mon Sep 17 00:00:00 2001 From: fdai7736 Date: Wed, 7 Feb 2024 21:07:44 +0100 Subject: [PATCH] add property change support for currentCard --- src/main/java/de/hsfulda/onses/models/Player.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/de/hsfulda/onses/models/Player.java b/src/main/java/de/hsfulda/onses/models/Player.java index 9dbfa14..15dd5f7 100644 --- a/src/main/java/de/hsfulda/onses/models/Player.java +++ b/src/main/java/de/hsfulda/onses/models/Player.java @@ -7,6 +7,7 @@ import java.util.ArrayList; public class Player { public final static String PROPERTY_PLAYER_DECK = "playerDeck"; + public final static String PROPERTY_CURRENT_CARD = "currentCard"; protected PropertyChangeSupport listeners; @@ -74,7 +75,9 @@ public class Player { } public Player setCurrentCard(Card currentCard) { + final Card oldCard = this.currentCard; this.currentCard = currentCard; + this.firePropertyChange(PROPERTY_CURRENT_CARD, oldCard, currentCard); return this; }