Class RemoveMessage


  • public class RemoveMessage
    extends AttributeMessage
    The message sent when removing a FreeColGameObject.
    • Constructor Detail

      • RemoveMessage

        public RemoveMessage​(java.lang.String divertId,
                             java.util.List<? extends FreeColGameObject> objects)
        Create a new RemoveMessage.
        Parameters:
        divertId - The identifier of an object to divert message attribution to.
        objects - A list of FreeColGameObjects to remove.
      • RemoveMessage

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

      • getAttributeMap

        private static java.util.Map<java.lang.String,​java.lang.String> getAttributeMap​(FreeColXMLReader xr)
        Get the attributes as a map.
        Parameters:
        xr - A FreeColXMLReader to read from.
        Returns:
        A map of the attributes.
      • 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.
      • getDivertObject

        public FreeColGameObject getDivertObject​(Game game)
        Get the divert object.
        Parameters:
        game - The Game to look in.
        Returns:
        The divert object, or null if none found.
      • getRemovals

        public java.util.List<FreeColGameObject> getRemovals​(Game game)
        Get the objects to remove.
        Parameters:
        game - The Game to look in.
        Returns:
        A list of FreeColGameObjects to remove.