Browse Source

Relationship Player_PlayerService

main
fdai7920 11 months ago
parent
commit
1a0709253e
  1. 10
      src/main/java/de/hsfulda/onses/models/Player.java
  2. 4
      src/main/java/de/hsfulda/onses/services/PlayerService.java

10
src/main/java/de/hsfulda/onses/models/Player.java

@ -7,6 +7,7 @@ import java.util.ArrayList;
public class Player { public class Player {
private PlayerService playerService; private PlayerService playerService;
private Game game;
private final ArrayList<Card> playerDeck = new ArrayList<>(); private final ArrayList<Card> playerDeck = new ArrayList<>();
public ArrayList<Card> getPlayerDeck() { public ArrayList<Card> getPlayerDeck() {
@ -27,4 +28,13 @@ public class Player {
this.playerService = playerService; this.playerService = playerService;
return this; return this;
} }
public Game getGame() {
return game;
}
public Player setGame(Game game) {
this.game = game;
return this;
}
} }

4
src/main/java/de/hsfulda/onses/services/PlayerService.java

@ -44,7 +44,7 @@ public class PlayerService {
public 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));
} }
} }
Loading…
Cancel
Save