From d8fe01936acf7124dd7da2763e7ef2d77bd748d5 Mon Sep 17 00:00:00 2001 From: fdai7736 Date: Thu, 8 Feb 2024 12:11:46 +0100 Subject: [PATCH] refactoring: set player to card by addCard --- src/main/java/de/hsfulda/onses/models/Player.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/hsfulda/onses/models/Player.java b/src/main/java/de/hsfulda/onses/models/Player.java index 15dd5f7..e20dd1d 100644 --- a/src/main/java/de/hsfulda/onses/models/Player.java +++ b/src/main/java/de/hsfulda/onses/models/Player.java @@ -23,6 +23,7 @@ public class Player { } public void addCardToPlayerDeck(Card card) { + card.setPlayer(this); final ArrayList oldplayerDeck = new ArrayList<>(this.playerDeck); playerDeck.add(card); this.firePropertyChange(PROPERTY_PLAYER_DECK, oldplayerDeck, playerDeck);