Class NewRegionNameMessage


  • public class NewRegionNameMessage
    extends AttributeMessage
    The message sent when naming a new region.
    • Constructor Detail

      • NewRegionNameMessage

        public NewRegionNameMessage​(Region region,
                                    Tile tile,
                                    Unit unit,
                                    java.lang.String newRegionName)
        Create a new NewRegionNameMessage with the supplied name.
        Parameters:
        region - The Region being discovered.
        tile - The Tile where the region is discovered.
        unit - The Unit that discovers the region.
        newRegionName - The default new region name.
      • NewRegionNameMessage

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

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

        public Region getRegion​(Game game)
        Public accessor for the region.
        Parameters:
        game - The Game to look for a region in.
        Returns:
        The region of this message.
      • getTile

        public Tile getTile​(Game game)
        Public accessor for the tile.
        Parameters:
        game - The Game to look for a tile in.
        Returns:
        The tile of this message.
      • getUnit

        public Unit getUnit​(Player player)
        Public accessor for the unit.
        Parameters:
        player - The Player who owns the unit.
        Returns:
        The Unit of this message.
      • getNewRegionName

        public java.lang.String getNewRegionName()
        Public accessor for the new region name.
        Returns:
        The new region name of this message.