Updated 'RollDiceState' class.

Updated the 'RollDiceState' class by adding the 'received(RequestDieMessage msg, int from)' method to it.
This commit is contained in:
Daniel Grigencha
2024-12-06 04:17:29 +01:00
parent 23ae4a3080
commit 72f0bc5a2f

View File

@@ -1,5 +1,6 @@
package pp.mdga.server.automaton.game.turn;
import pp.mdga.message.client.RequestDieMessage;
import pp.mdga.server.ServerGameLogic;
import pp.mdga.server.automaton.game.TurnState;
import pp.mdga.server.automaton.game.turn.rolldice.FirstRollState;
@@ -45,6 +46,18 @@ public void exit() {
LOGGER.log(System.Logger.Level.DEBUG, "Exited RollDiceState state.");
}
/**
* This method will be called whenever the server received a RequestDieMessage 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 RequestDieMessage object.
* @param from as the client id of the player as an Integer.
*/
@Override
public void received(RequestDieMessage msg, int from) {
this.currentState.received(msg, from);
}
/**
* This method will be used to return currentState attribute of RollDiceState class.
*