Class GameSetupHandler
java.lang.Object
it.polimi.ingsw.eriantys.controller.phases.GameSetupHandler
- All Implemented Interfaces:
MessageHandler
This concrete implementation for the state design pattern involving
MessageHandler
defines how the game setup phase message GameSetupSelection should be processed.-
Constructor Summary
ConstructorsConstructorDescriptionGameSetupHandler(Game game) Constructs a newGameSetupHandlerfor the specified game. -
Method Summary
Modifier and TypeMethodDescriptiongetHelp()Returns a help message which lists the possible user actions for the current phase of the game.voidHandles and responds to the specified message received by the client, according to the rules regarding the current phase of the game.voidhandleDisconnectedUser(String username) Plays the specified user's turn according to the rules if they are disconnected and the game is not idle.voidsendReconnectUpdate(String username) 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.
-
Constructor Details
-
GameSetupHandler
Constructs a newGameSetupHandlerfor the specified game.- Parameters:
game- theGamethis message handler refers to.
-
-
Method Details
-
handle
Description copied from interface:MessageHandlerHandles and responds to the specified message received by the client, according to the rules regarding the current phase of the game.- Specified by:
handlein interfaceMessageHandler- Parameters:
m- theGameMessagereceived by the client.- Throws:
NoConnectionException- if no connection can be retrieved for the sender of the message.
-
getHelp
Description copied from interface:MessageHandlerReturns a help message which lists the possible user actions for the current phase of the game.- Specified by:
getHelpin interfaceMessageHandler- Returns:
- a help message which lists the possible user actions for the current phase of the game.
-
handleDisconnectedUser
Description copied from interface:MessageHandlerPlays the specified user's turn according to the rules if they are disconnected and the game is not idle.- Specified by:
handleDisconnectedUserin interfaceMessageHandler- Parameters:
username- the disconnected user's username.
-
sendReconnectUpdate
Description copied from interface:MessageHandlerSends 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.- Specified by:
sendReconnectUpdatein interfaceMessageHandler- Parameters:
username- the reconnected user's username.
-