diff --git a/src/main/java/de/hsfulda/onses/models/Player.java b/src/main/java/de/hsfulda/onses/models/Player.java index 77eb2b1..3f92e8d 100644 --- a/src/main/java/de/hsfulda/onses/models/Player.java +++ b/src/main/java/de/hsfulda/onses/models/Player.java @@ -1,9 +1,12 @@ package de.hsfulda.onses.models; +import de.hsfulda.onses.services.PlayerService; + import java.util.ArrayList; public class Player { + private PlayerService playerService; private final ArrayList playerDeck = new ArrayList<>(); public ArrayList getPlayerDeck() { @@ -13,4 +16,15 @@ public class Player { public void addCardToPlayerDeck(Card card) { playerDeck.add(card); } + + + + public PlayerService getPlayerService() { + return playerService; + } + + public Player setPlayerService(PlayerService playerService) { + this.playerService = playerService; + 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 32d1c5e..61c5eff 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -41,4 +41,10 @@ public class PlayerService { this.game = game; return this; } + + public PlayerService() + { + addPlayerToList(new Player().setPlayerService(this)); + addPlayerToList(new Player().setPlayerService(this)); + } }