diff --git a/src/main/java/de/hsfulda/onses/models/Player.java b/src/main/java/de/hsfulda/onses/models/Player.java index 3f92e8d..88ce707 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 { private PlayerService playerService; + private Game game; private final ArrayList playerDeck = new ArrayList<>(); public ArrayList getPlayerDeck() { @@ -27,4 +28,13 @@ public class Player { this.playerService = playerService; return this; } + + public Game getGame() { + return game; + } + + public Player setGame(Game game) { + this.game = game; + return this; + } } diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index 61c5eff..a9f651e 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -44,7 +44,7 @@ public class PlayerService { public PlayerService() { - addPlayerToList(new Player().setPlayerService(this)); - addPlayerToList(new Player().setPlayerService(this)); + addPlayerToList(new Player().setPlayerService(this).setGame(this.game)); + addPlayerToList(new Player().setPlayerService(this).setGame(this.game)); } }