From 4904b32ea36e5f8310ffff829a54f7bd04beb7f5 Mon Sep 17 00:00:00 2001 From: Daniel Grigencha Date: Fri, 6 Dec 2024 08:58:51 +0100 Subject: [PATCH] Updated 'ChoosePieceState' class. Updated the 'ChoosePieceState' class by adding the 'RequestMoveMessage' handling to it. --- .../automaton/game/turn/ChoosePieceState.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/ChoosePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/ChoosePieceState.java index 63479370..06765f8f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/ChoosePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/ChoosePieceState.java @@ -1,5 +1,6 @@ package pp.mdga.server.automaton.game.turn; +import pp.mdga.message.client.RequestMoveMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.TurnState; import pp.mdga.server.automaton.game.turn.choosepiece.*; @@ -46,6 +47,18 @@ public void exit() { LOGGER.log(System.Logger.Level.DEBUG, "Entered ChoosePieceState state."); } + /** + * This method will be called whenever the server received a RequestMoveMessage message. + * It will also get the client id of the player who send this message. + * + * @param msg as the message which was sent by the player as a RequestMoveMessage object. + * @param from as the client id of the player as an Integer. + */ + @Override + public void received(RequestMoveMessage msg, int from) { + this.currentState.received(msg, from); + } + /** * This method will be used to return currentState attribute of ChoosePieceState class. *