mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 22:49:44 +01:00
saving the players
This commit is contained in:
parent
d582c59a7d
commit
e780513b35
@ -5,6 +5,7 @@ import java.lang.System.Logger.Level;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import pp.monopoly.game.server.Player;
|
||||
import pp.monopoly.message.client.ClientMessage;
|
||||
import pp.monopoly.message.server.BuyPropertyResponse;
|
||||
import pp.monopoly.message.server.DiceResult;
|
||||
@ -50,6 +51,8 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
||||
/** The current state of the client game logic. */
|
||||
private ClientState state = new LobbyState(this);
|
||||
|
||||
private List<Player> players;
|
||||
|
||||
/**
|
||||
* Constructs a ClientGameLogic with the specified sender object.
|
||||
*
|
||||
@ -80,6 +83,10 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
||||
state.entry();
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the player's game board.
|
||||
*
|
||||
@ -236,6 +243,7 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
||||
*/
|
||||
@Override
|
||||
public void received(GameStart msg) {
|
||||
players = msg.getPlayers();
|
||||
setInfoText("The game has started! Good luck!");
|
||||
setState(new WaitForTurnState(this));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user