Class NativeGiftMessage


  • public class NativeGiftMessage
    extends AttributeMessage
    The message sent when a native delivers a gift to a Colony.
    • Constructor Detail

      • NativeGiftMessage

        public NativeGiftMessage​(Unit unit,
                                 Colony colony)
        Create a new NativeGiftMessage.
        Parameters:
        unit - The Unit that is trading.
        colony - The Colony that is trading.
      • NativeGiftMessage

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

      • 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.
      • 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.
      • 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.