net.sf.freecol.common.networking
Class NewRegionNameMessage

java.lang.Object
  extended by net.sf.freecol.common.networking.DOMMessage
      extended by net.sf.freecol.common.networking.NewRegionNameMessage

public class NewRegionNameMessage
extends DOMMessage

The message sent when naming a new region.


Field Summary
private  java.lang.String newRegionName
          The new name.
private  java.lang.String regionId
          The ID of the region being discovered.
private  java.lang.String tileId
          The tile where the region is discovered.
 
Fields inherited from class net.sf.freecol.common.networking.DOMMessage
document, logger
 
Constructor Summary
NewRegionNameMessage(Game game, org.w3c.dom.Element element)
          Create a new NewRegionNameMessage from a supplied element.
NewRegionNameMessage(Region region, Tile tile, java.lang.String newRegionName)
          Create a new NewRegionNameMessage with the supplied name.
 
Method Summary
 java.lang.String getNewRegionName()
          Public accessor for the new region name.
 Region getRegion(Game game)
          Public accessor for the region.
 Tile getTile(Game game)
          Public accessor for the tile.
static java.lang.String getXMLElementTagName()
          The tag name of the root element representing this object.
 org.w3c.dom.Element handle(FreeColServer server, Player player, Connection connection)
          Handle a "newRegionName"-message.
 org.w3c.dom.Element toXMLElement()
          Convert this NewRegionNameMessage to XML.
 
Methods inherited from class net.sf.freecol.common.networking.DOMMessage
clientError, collapseElements, createError, createError, createNewDocument, createNewRootElement, elementToString, getAttribute, getChildElement, getDocument, getFreeColProtocolVersion, getType, hasAttribute, insertAsRoot, isType, setAttribute, setAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

regionId

private java.lang.String regionId
The ID of the region being discovered.


tileId

private java.lang.String tileId
The tile where the region is discovered.


newRegionName

private java.lang.String newRegionName
The new name.

Constructor Detail

NewRegionNameMessage

public NewRegionNameMessage(Region region,
                            Tile tile,
                            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.
newRegionName - The default new region name.

NewRegionNameMessage

public NewRegionNameMessage(Game game,
                            org.w3c.dom.Element element)
Create a new NewRegionNameMessage from a supplied element.

Parameters:
game - The Game this message belongs to.
element - The Element to use to create the message.
Method Detail

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.

getNewRegionName

public java.lang.String getNewRegionName()
Public accessor for the new region name.

Returns:
The new region name of this message.

handle

public org.w3c.dom.Element handle(FreeColServer server,
                                  Player player,
                                  Connection connection)
Handle a "newRegionName"-message.

Parameters:
server - The FreeColServer handling the message.
player - The Player the message applies to.
connection - The Connection message was received on.
Returns:
Null.

toXMLElement

public org.w3c.dom.Element toXMLElement()
Convert this NewRegionNameMessage to XML.

Overrides:
toXMLElement in class DOMMessage
Returns:
The XML representation of this message.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
The tag name of the root element representing this object.

Returns:
"newRegionName".