Updated 'ChoosePieceState' class.
Updated the 'ChoosePieceState' class by adding the 'RequestMoveMessage' handling to it.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user