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