Class SetAvailableMessage


  • public class SetAvailableMessage
    extends AttributeMessage
    The message that changes the player availability.
    • Constructor Detail

      • SetAvailableMessage

        public SetAvailableMessage​(Nation nation,
                                   NationOptions.NationState state)
        Create a new SetAvailableMessage.
        Parameters:
        nation - The Nation to make available.
        state - The NationState for that nation.
      • SetAvailableMessage

        public SetAvailableMessage​(Game game,
                                   FreeColXMLReader xr)
                            throws javax.xml.stream.XMLStreamException
        Create a new SetAvailableMessage from a stream.
        Parameters:
        game - The Game this message belongs to (null here).
        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.
      • getNation

        public Nation getNation​(Specification spec)
        Get the nation whose availability is changing.
        Parameters:
        spec - The Specification to look up the nation in.
        Returns:
        The Nation found.
      • getNationState

        public NationOptions.NationState getNationState()
        Get the new nation availabiility.
        Returns:
        The new NationState.