Class ExpertCommunicationController


public class ExpertCommunicationController extends CommunicationController
  • Constructor Details

  • Method Details

    • initializeGameStateController

      protected GameStateController initializeGameStateController(int playersNumber) throws GameStateInitializationFailureException
      Overrides:
      initializeGameStateController in class CommunicationController
      Throws:
      GameStateInitializationFailureException
    • initializeGameStateController

      protected GameStateController initializeGameStateController(UUID gameUUID)
      Overrides:
      initializeGameStateController in class CommunicationController
    • characterIndexMsg

      public SugarMessage characterIndexMsg(CharacterIndexMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 2,4,6 and 8. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Parameters:
      message - is the CharacterIndexMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation
    • characterIndexArchipelagoMsg

      public SugarMessage characterIndexArchipelagoMsg(CharacterIndexArchipelagoMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 3 and 5. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Parameters:
      message - is the CharacterIndexArchipelagoMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation
    • characterIndexColorMsg

      public SugarMessage characterIndexColorMsg(CharacterIndexColorMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 9, 11 and 12. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Parameters:
      message - is the CharacterIndexColorMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation
    • characterIndexColorArchipelagoMsg

      public SugarMessage characterIndexColorArchipelagoMsg(CharacterIndexColorArchipelagoMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 1. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Parameters:
      message - is the CharacterIndexColorArchipelagoMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation
    • characterIndexColorListsMsg

      public SugarMessage characterIndexColorListsMsg(CharacterIndexColorListsMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 1. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Parameters:
      message - is the CharacterIndexColorListsMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation
    • rollbackMsg

      public SugarMessage rollbackMsg(RollbackMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 1. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Overrides:
      rollbackMsg in class CommunicationController
      Parameters:
      message - is the RollbackMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation
    • endTurnMsg

      public SugarMessage endTurnMsg(EndTurnMsg message, Peer peer)
      This is the handler of the messages for the characters with ID 1. It manages all the exceptions related to the rules of the game and notifies the player with the result.
      Overrides:
      endTurnMsg in class CommunicationController
      Parameters:
      message - is the EndTurnMsg received from the player
      peer - is the Peer from which the message is received
      Returns:
      a SugarMessage with the result of the invocation