Class NewLandNameMessage


  • public class NewLandNameMessage
    extends AttributeMessage
    The message sent when naming a new land.
    • Constructor Detail

      • NewLandNameMessage

        public NewLandNameMessage​(Unit unit,
                                  java.lang.String newLandName)
        Create a new NewLandNameMessage with the supplied name.
        Parameters:
        unit - The Unit that has come ashore.
        newLandName - The new land name.
      • NewLandNameMessage

        public NewLandNameMessage​(Game game,
                                  FreeColXMLReader xr)
                           throws javax.xml.stream.XMLStreamException
        Create a new NewLandNameMessage 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

      • aiHandler

        public void aiHandler​(FreeColServer freeColServer,
                              AIPlayer aiPlayer)
        AI-side handler for this message. AI handlers always return null. FIXME: One day the FreeColServer should devolve to AIMain.
        Overrides:
        aiHandler in class TrivialMessage
        Parameters:
        freeColServer - The FreeColServer handling the request.
        aiPlayer - The AIPlayer the message was sent to.
      • 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.
      • getUnit

        public Unit getUnit​(Player player)
        Public accessor for the unit.
        Parameters:
        player - The Player who owns the unit.
        Returns:
        The Unit of this message.
      • getNewLandName

        public java.lang.String getNewLandName()
        Public accessor for the new land name.
        Returns:
        The new land name of this message.