Class ReadyMessage


  • public class ReadyMessage
    extends AttributeMessage
    The message that signals a player is ready.
    • Constructor Detail

      • ReadyMessage

        public ReadyMessage​(Player player,
                            boolean ready)
        Create a new ReadyMessage with the given player and state.
        Parameters:
        player - The Player to set.
        ready - True if the player is ready.
      • ReadyMessage

        public ReadyMessage​(Game game,
                            FreeColXMLReader xr)
                     throws javax.xml.stream.XMLStreamException
        Create a new ReadyMessage from a stream.
        Parameters:
        game - The Game to read within.
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if the stream is corrupt.
    • Method Detail

      • clientHandler

        public void clientHandler​(FreeColClient freeColClient)
        Client-side handler for this message. Client handlers always return null.
        Overrides:
        clientHandler in class TrivialMessage
        Parameters:
        freeColClient - The FreeColClient to handle this message.
      • serverHandler

        public ChangeSet serverHandler​(FreeColServer freeColServer,
                                       ServerPlayer serverPlayer)
        Server-side handler for this message.
        Overrides:
        serverHandler in class TrivialMessage
        Parameters:
        freeColServer - The FreeColServer handling the request.
        serverPlayer - The ServerPlayer that sent the request.
        Returns:
        A ChangeSet defining the response.
      • getPlayer

        public Player getPlayer​(Game game)
        Which player is to be set?
        Parameters:
        game - The Game the player is in.
        Returns:
        The Player to set the AI state of.
      • getValue

        public boolean getValue()
        Get the ready state.
        Returns:
        True if the player is ready.