Class DeliverGiftMessage


  • public class DeliverGiftMessage
    extends ObjectMessage
    The message sent when delivering a gift to a Settlement.
    • Constructor Detail

      • DeliverGiftMessage

        public DeliverGiftMessage​(Unit unit,
                                  IndianSettlement is,
                                  Goods goods)
        Create a new DeliverGiftMessage.
        Parameters:
        unit - The Unit that is trading.
        is - The IndianSettlement that is trading.
        goods - The Goods to deliverGift.
      • DeliverGiftMessage

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

      • getGoods

        private Goods getGoods()
        Get the Goods delivered as a gift.
        Returns:
        The Goods, or null if none.
      • 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.