Browse Source

refactoring: divided function in 2 parts

main
fdai7920 11 months ago
parent
commit
57763309bf
  1. 6
      src/main/java/de/hsfulda/onses/services/PlayerService.java

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

@ -39,12 +39,14 @@ public class PlayerService {
public PlayerService setGame(Game game) {
this.game = game;
playerList.getFirst().setGame(this.game);
playerList.getLast().setGame(this.game);
return this;
}
public PlayerService()
{
addPlayerToList(new Player().setPlayerService(this).setGame(this.game));
addPlayerToList(new Player().setPlayerService(this).setGame(this.game));
addPlayerToList(new Player().setPlayerService(this));
addPlayerToList(new Player().setPlayerService(this));
}
}
Loading…
Cancel
Save