diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java index c9c1bbd..dbb57fb 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java @@ -19,7 +19,6 @@ public class PlayerHandler { private List players = new LinkedList<>(); private Set readyPlayers = new HashSet<>(); private transient ServerGameLogic logic; - private Player hostPlayer; private Player extra = null; /** @@ -55,14 +54,6 @@ public class PlayerHandler { players.addAll(players); } - /** - * Return the host player - * @return the host player - */ - public Player getHostPlayer() { - return hostPlayer; - } - /** * Return the number of players * @return number of players in the game @@ -114,9 +105,6 @@ public class PlayerHandler { throw new IllegalArgumentException("Player already registered"); } players.add(player); - if(hostPlayer == null) { - hostPlayer = player; - } } /** diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java index 6751436..7e2c13e 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java @@ -189,7 +189,7 @@ public class ServerGameLogic implements ClientInterpreter { @Override public void received(PlayerReady msg, int from) { Player player = playerHandler.getPlayerById(from); - if(player == playerHandler.getHostPlayer()) { + if(player.getId() == 0) { startMoney = msg.getStartMoney(); }