From e780513b3506b9b82af681e377197004dfbb4c10 Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Sun, 24 Nov 2024 00:32:16 +0100 Subject: [PATCH] saving the players --- .../java/pp/monopoly/game/client/ClientGameLogic.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java index 5803afd..2eccfa6 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java @@ -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 players; + /** * Constructs a ClientGameLogic with the specified sender object. * @@ -80,6 +83,10 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker { state.entry(); } + public List 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)); }