Class SpySettlementMessage


  • public class SpySettlementMessage
    extends ObjectMessage
    The message sent when spying on a settlement.
    • Constructor Detail

      • SpySettlementMessage

        public SpySettlementMessage​(Unit unit,
                                    Settlement settlement)
        Create a new SpySettlementMessage request with the supplied unit and settlement
        Parameters:
        unit - The Unit that is spying.
        settlement - The Settlement the unit is looking at.
      • SpySettlementMessage

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

      • getSpyTile

        private Tile getSpyTile()
      • getUnit

        private Unit getUnit​(Player player)
      • getColony

        private Colony getColony​(Game game)
      • writeChildren

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