Class PlayCharacterCardHandler

java.lang.Object
it.polimi.ingsw.eriantys.controller.phases.PlayCharacterCardHandler
All Implemented Interfaces:
MessageHandler
Direct Known Subclasses:
MotherNatureDestinationHandler, MoveStudentHandler, SelectCloudHandler

public abstract class PlayCharacterCardHandler extends Object implements MessageHandler
This concrete implementation for the state design pattern involving MessageHandler defines how the action phase message PlayCharacterCard should be processed.
  • Field Details

    • game

      protected final Game game
  • Constructor Details

    • PlayCharacterCardHandler

      public PlayCharacterCardHandler(Game game)
      Constructs a new PlayCharacterCardHandler 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
      Parameters:
      m - the GameMessage received by the client.
      Throws:
      NoConnectionException - if no connection can be retrieved for the sender of the message.
    • getHelp

      public String getHelp()
      Description copied from interface: MessageHandler
      Returns a help message which lists the possible user actions for the current phase of the game.
      Specified by:
      getHelp in interface MessageHandler
      Returns:
      a help message which lists the possible user actions for the current phase of the game.