Class UpdateMessage


  • public class UpdateMessage
    extends ObjectMessage
    The message sent to update game objects.
    • Field Detail

      • destination

        private final Player destination
        The player to specialize the objects for.
    • Constructor Detail

      • UpdateMessage

        private UpdateMessage​(Player destination)
        Create a new UpdateMessage.
        Parameters:
        destination - The destination Player.
      • UpdateMessage

        public UpdateMessage​(Player destination,
                             FreeColGameObject fcgo)
        Create a new UpdateMessage.
        Parameters:
        destination - The destination Player.
        fcgo - A FreeColGameObjects to add.
      • UpdateMessage

        public UpdateMessage​(Player destination,
                             java.util.List<FreeColGameObject> fcgos)
        Create a new UpdateMessage.
        Parameters:
        destination - The destination Player.
        fcgos - A list of FreeColObjects to add.
      • UpdateMessage

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

      • merge

        public boolean merge​(Message message)
        Merge another message into this message if possible.
        Overrides:
        merge in class Message
        Parameters:
        message - The Message to merge.
        Returns:
        True if the other message was merged.
      • toXML

        public void toXML​(FreeColXMLWriter xw)
                   throws javax.xml.stream.XMLStreamException
        Write this message as XML.
        Overrides:
        toXML in class Message
        Parameters:
        xw - The FreeColXMLWriter to write with.
        Throws:
        javax.xml.stream.XMLStreamException - if there is a problem writing the stream.
      • 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.