Class MoveStudentHandler

java.lang.Object
it.polimi.ingsw.eriantys.controller.phases.PlayCharacterCardHandler
it.polimi.ingsw.eriantys.controller.phases.MoveStudentHandler
All Implemented Interfaces:
MessageHandler

public class MoveStudentHandler extends PlayCharacterCardHandler
This concrete implementation for the state design pattern involving MessageHandler defines how the action phase message MoveStudent should be processed.
  • Constructor Details

    • MoveStudentHandler

      public MoveStudentHandler(Game game)
      Constructs a new MoveStudentHandler for the specified game.
      Parameters:
      game - the Game this message handler refers to.
  • Method Details

    • handle

      public void handle(GameMessage m) throws NoConnectionException
      Description copied from interface: MessageHandler
      Handles and responds to the specified message received by the client, according to the rules regarding the current phase of the game.
      Specified by:
      handle in interface MessageHandler
      Overrides:
      handle in class PlayCharacterCardHandler
      Parameters:
      m - the GameMessage received by the client.
      Throws:
      NoConnectionException - if no connection can be retrieved for the sender of the message.
    • handleDisconnectedUser

      public void handleDisconnectedUser(String username)
      Description copied from interface: MessageHandler
      Plays the specified user's turn according to the rules if they are disconnected and the game is not idle.
      Parameters:
      username - the disconnected user's username.
    • sendReconnectUpdate

      public void sendReconnectUpdate(String username)
      Description copied from interface: MessageHandler
      Sends a broadcast update after the specified user's reconnection in order to make sure every player has the information they need in order to play.
      Parameters:
      username - the reconnected user's username.