mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-25 01:09:46 +01:00
fixed addPlayer
This commit is contained in:
parent
3bdfd6a78a
commit
10b978debf
@ -40,12 +40,16 @@ public class Player implements FieldVisitor<Void>{
|
|||||||
private int rollResult;
|
private int rollResult;
|
||||||
private PlayerHandler handler;
|
private PlayerHandler handler;
|
||||||
|
|
||||||
Player(int id, String name, PlayerHandler handler) {
|
public Player(int id, String name, PlayerHandler handler) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Player(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ public class MonopolyServer implements MessageListener<HostedConnection>, Connec
|
|||||||
@Override
|
@Override
|
||||||
public void connectionAdded(Server server, HostedConnection hostedConnection) {
|
public void connectionAdded(Server server, HostedConnection hostedConnection) {
|
||||||
LOGGER.log(Level.INFO, "new connection {0}", hostedConnection); //NON-NLS
|
LOGGER.log(Level.INFO, "new connection {0}", hostedConnection); //NON-NLS
|
||||||
logic.addPlayer(hostedConnection.getId());
|
logic.addPlayer(new Player(hostedConnection.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user