Class DeclareIndependenceMessage


  • public class DeclareIndependenceMessage
    extends AttributeMessage
    The message sent when a player declares independence.
    • Constructor Detail

      • DeclareIndependenceMessage

        public DeclareIndependenceMessage​(java.lang.String nationName,
                                          java.lang.String countryName)
        Create a new DeclareIndependenceMessage with the supplied name.
        Parameters:
        nationName - The new name for the rebelling nation.
        countryName - The new name for the rebelling country.
      • DeclareIndependenceMessage

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

      • currentPlayerMessage

        public boolean currentPlayerMessage()
        Should this message only be sent to a server by the current player?
        Overrides:
        currentPlayerMessage in class TrivialMessage
        Returns:
        True if this is a current-player-only 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.