diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java index 75db297..35be5cd 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java @@ -40,12 +40,16 @@ public class Player implements FieldVisitor{ private int rollResult; private PlayerHandler handler; - Player(int id, String name, PlayerHandler handler) { + public Player(int id, String name, PlayerHandler handler) { this.name = name; this.id = id; this.handler = handler; } + public Player(int id) { + this.id = id; + } + public int getId() { return id; } diff --git a/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java b/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java index 73aaa17..ff77c8a 100644 --- a/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java +++ b/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java @@ -120,7 +120,7 @@ public class MonopolyServer implements MessageListener, Connec @Override public void connectionAdded(Server server, HostedConnection hostedConnection) { LOGGER.log(Level.INFO, "new connection {0}", hostedConnection); //NON-NLS - logic.addPlayer(hostedConnection.getId()); + logic.addPlayer(new Player(hostedConnection.getId())); } @Override