|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.FreeColGameObject
net.sf.freecol.common.model.UnitLocation
net.sf.freecol.common.model.Tile
public final class Tile
Represents a single tile on the Map.
Map| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.sf.freecol.common.model.UnitLocation |
|---|
UnitLocation.NoAddReason |
| Field Summary | |
|---|---|
private boolean |
connected
Whether this tile is connected to Europe. |
private static java.util.logging.Logger |
logger
|
private java.lang.Boolean |
moveToEurope
Does this tile have an explicit moveToEurope state. |
static int |
NEAR_RADIUS
The maximum distance that will still be considered "near" when determining the location name. |
private Player |
owner
The player that consider this tile to be their land. |
private Settlement |
owningSettlement
Indicates which colony or Indian settlement that owns this tile ('null' indicates no owner). |
private java.util.Map<Player,PlayerExploredTile> |
playerExploredTiles
Stores each player's image of this tile. |
private Region |
region
Describe region here. |
private Settlement |
settlement
A pointer to the settlement located on this tile or 'null' if there is no settlement on this tile. |
private int |
style
The style of this Tile, as determined by adjacent tiles. |
private TileItemContainer |
tileItemContainer
Stores all Improvements and Resources (if any) |
private TileType |
type
|
static java.lang.String |
UNIT_CHANGE
|
private int |
x
|
private int |
y
|
| Fields inherited from class net.sf.freecol.common.model.FreeColGameObject |
|---|
UNITS_TAG_NAME |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
Tile(Game game,
java.lang.String id)
Initiates a new Tile with the given ID. |
|
Tile(Game game,
TileType type,
int locX,
int locY)
A constructor to use. |
|
Tile(Game game,
javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
|
| Method Summary | |
|---|---|
boolean |
add(Locatable locatable)
Adds a Locatable to this Location. |
void |
addLostCityRumour(LostCityRumour rumour)
Adds a lost city rumour to this tile. |
void |
addResource(Resource resource)
Adds a Resource to this Tile. |
private void |
addTileItem(TileItem item)
Adds a tile item to this tile. |
boolean |
canAdd(Locatable locatable)
Checks whether or not the specified locatable may be added to this Location. |
boolean |
canGetRoad()
Checks whether this Tile can have a road or not. |
boolean |
canMoveToEurope()
Can a unit move to Europe from this tile? |
void |
changeOwnership(Player player,
Settlement settlement)
Change the tile ownership. |
void |
changeOwningSettlement(Settlement settlement)
Changes the owning settlement for this tile. |
boolean |
contains(Locatable locatable)
Checks if this Tile contains the specified
Locatable. |
void |
dispose()
Dispose of this UnitLocation. |
void |
disposeScratchTile()
Special handling on dispose to avoid mutating the shared fields. |
Resource |
expendResource(GoodsType goodsType,
UnitType unitType,
Settlement settlement)
This method is called only when a new turn is beginning. |
TileImprovement |
findTileImprovementType(TileImprovementType type)
Finds the TileImprovement of a given Type, or null if there is no match. |
void |
fixup09x()
Fixes visible pets where there is a settlement present but the tile is not owned correctly as ownership was not implemented in 0.9.x. |
Tile |
getAdjacentTile(Map.Direction direction)
Gets the position adjacent Tile to a given Tile, in a given direction. |
Colony |
getColony()
Gets the Colony located on this Tile. |
java.util.List<TileImprovement> |
getCompletedTileImprovements()
Returns a List of completed TileImprovements. |
Unit |
getDefendingUnit(Unit attacker)
Gets the Unit that is currently defending this
Tile. |
Map.Direction |
getDirection(Tile tile)
Gets the direction to a neighbouring tile from this one. |
Region |
getDiscoverableRegion()
Return the discoverable Region of this Tile, or null if there is none. |
int |
getDistanceTo(Tile tile)
Gets the distance in tiles between this Tile and the
specified one. |
Unit |
getFirstUnit()
Gets the first Unit on this tile. |
IndianSettlement |
getIndianSettlement()
Gets the IndianSettlement located on this
Tile. |
StringTemplate |
getLabel()
Returns a description of the Tile, with the name of the tile
and any improvements on it (road/plow/etc) from TileItemContainer. |
Unit |
getLastUnit()
Gets the last Unit on this tile. |
StringTemplate |
getLocationName()
Returns the name of this location. |
StringTemplate |
getLocationNameFor(Player player)
Returns the name of this location for a particular player. |
LostCityRumour |
getLostCityRumour()
Gets the lost city rumour on this Tile if any. |
Map |
getMap()
Gets the Map in which this Tile belongs. |
int |
getMaximumPotential(GoodsType goodsType,
UnitType unitType)
Gets the maximum potential for producing the given type of goods. |
Unit |
getMovableUnit()
Gets a Unit that can become active. |
java.lang.Boolean |
getMoveToEurope()
Get the move-to-Europe state of the tile. |
java.lang.String |
getNameKey()
Gets the name of this tile, or shows "unexplored" if not explored by player. |
Settlement |
getNearestSettlement(Player owner,
int radius)
Finds the nearest settlement to this tile. |
Tile |
getNeighbourOrNull(Map.Direction direction)
Returns the neighbouring Tile of the given Tile in the given direction. |
Unit |
getOccupyingUnit()
Returns the unit who is occupying the tile |
Player |
getOwner()
The nation that consider this tile to be their property. |
Settlement |
getOwningSettlement()
Gets the owning settlement for this tile. |
PlayerExploredTile |
getPlayerExploredTile(Player player)
Gets the PlayerExploredTile for the given
Player. |
Map.Position |
getPosition()
Gets the Position of this Tile. |
java.util.Set<Modifier> |
getProductionBonus(GoodsType goodsType,
UnitType unitType)
Describe getProductionBonus method here. |
Region |
getRegion()
Get the Region value. |
TileImprovement |
getRiver()
Returns the river on this Tile if any |
int |
getRiverStyle()
Returns the style of a river TileImprovement on this Tile. |
TileImprovement |
getRoad()
Returns the road on this tile, if there is one, and null otherwise. |
Tile |
getSafeTile(Player player,
java.util.Random random)
Finds a safe tile to put a unit on, near to this one. |
Tile |
getScratchTile()
Creates a temporary copy of this tile for planning purposes. |
Settlement |
getSettlement()
Gets the Settlement located on this Tile. |
java.util.List<AbstractGoods> |
getSortedPotential()
Sorts GoodsTypes according to potential based on TileType, TileItemContainer if any. |
java.util.List<AbstractGoods> |
getSortedPotential(Unit unit)
Sorts GoodsTypes according to potential based on TileType, TileItemContainer if any. |
java.util.List<AbstractGoods> |
getSortedPotential(UnitType unitType,
Player owner)
Sorts GoodsTypes according to potential based on TileType, TileItemContainer if any. |
int |
getStyle()
Get the Style value. |
java.lang.Iterable<Tile> |
getSurroundingTiles(int range)
Returns all the tiles surrounding this tile within the given range. |
java.util.List<Tile> |
getSurroundingTiles(int rangeMin,
int rangeMax)
Returns all the tiles surrounding this tile within the given inclusive upper and lower bounds. |
Tile |
getTile()
Gets the Tile where this Location is
located or null if no Tile applies. |
java.util.List<TileImprovement> |
getTileImprovements()
Returns a List of TileImprovements. |
TileItemContainer |
getTileItemContainer()
Returns the TileItemContainer. |
static int |
getTileTypePotential(TileType tileType,
GoodsType goodsType,
TileItemContainer tiContainer,
UnitType unitType)
Calculates the potential of a certain GoodsType. |
int |
getTotalUnitCount()
Returns the total amount of Units at this Location. |
TileType |
getType()
Returns the type of this Tile. |
int |
getWorkAmount(TileImprovementType workType)
Returns the number of turns it takes for a non-expert pioneer to perform the given TileImprovementType. |
int |
getX()
Returns the x-coordinate of this Tile. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
int |
getY()
Returns the y-coordinate of this Tile. |
boolean |
hasImprovement(TileImprovementType type)
Will check whether this tile has a completed improvement of the given type. |
boolean |
hasLostCityRumour()
Returns true if this Tile has a lostCityRumour on it. |
boolean |
hasResource()
Returns true if this Tile has a resource on it. |
boolean |
hasRiver()
Returns true if this Tile has a River. |
boolean |
hasRoad()
Returns true if this Tile has a road. |
boolean |
hasUnexploredAdjacent()
Determine whether this tile has adjacent tiles that are unexplored. |
boolean |
isAdjacent(Tile tile)
Determines whether this tile is adjacent to the specified tile. |
boolean |
isAdjacentToMapEdge()
Checks if the given Tile is adjacent to the edge of the
map. |
boolean |
isAdjacentToVerticalMapEdge()
Checks if the given Tile is adjacent to the
east or west edge of the map. |
boolean |
isCoast()
Returns true if this tile has at least one adjacent land tile (if water), or at least one adjacent water tile (if land). |
boolean |
isConnected()
Whether this tile is connected to Europe. |
boolean |
isExplored()
Check if the tile has been explored. |
boolean |
isExploredBy(Player player)
Checks if this Tile has been explored by the given
Player. |
boolean |
isForested()
Returns true if this Tile is forested. |
boolean |
isInUse()
Is this tile under active use? |
boolean |
isLand()
Returns true if this Tile is a land Tile, 'false' otherwise. |
boolean |
isOccupied()
Checks whether there is a fortified enemy unit in the tile. |
boolean |
isPolar()
Is this tile in the polar regions? |
static boolean |
isSameTile(Location l1,
Location l2)
Are two locations non-null and either the same or at the same tile. |
boolean |
isViewShared()
|
int |
potential(GoodsType goodsType,
UnitType unitType)
The potential of this tile to produce a certain type of goods. |
protected void |
readAttributes(javax.xml.stream.XMLStreamReader in)
Reads the attributes of this object from an XML stream. |
protected void |
readChild(javax.xml.stream.XMLStreamReader in)
Reads a single child object. |
protected void |
readChildren(javax.xml.stream.XMLStreamReader in)
Reads the children of this object from an XML stream. |
boolean |
remove(Locatable locatable)
Removes a Locatable from this Location. |
void |
removeLostCityRumour()
Removes the lost city rumour from this Tile if there
is one. |
void |
setConnected(boolean newConnected)
Set the Connected value. |
void |
setExploredBy(Player player,
boolean explored)
Sets this Tile to be explored by the given
Player. |
void |
setMoveToEurope(java.lang.Boolean moveToEurope)
Set the move-to-Europe state of the tile. |
void |
setOwner(Player owner)
Sets the nation that should consider this tile to be their property. |
void |
setOwningSettlement(Settlement owner)
Sets the settlement that owns this tile. |
void |
setPosition(int x,
int y)
|
void |
setRegion(Region newRegion)
Set the Region value. |
void |
setSettlement(Settlement s)
Puts a Settlement on this Tile. |
void |
setStyle(int newStyle)
Set the Style value. |
void |
setTileItemContainer(TileItemContainer newTileItemContainer)
Sets the TileItemContainer. |
void |
setType(TileType t)
Sets the type for this Tile. |
java.lang.String |
toString()
Returns a String representation of this Tile. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out,
Player player,
boolean showAll,
boolean toSavedGame)
This method writes an XML-representation of this object to the given stream. |
void |
toXMLMinimal(javax.xml.stream.XMLStreamWriter out)
Write a minimal version of the tile. |
void |
updatePlayerExploredTile(Player player,
boolean full)
Updates the information about this Tile for the given
Player. |
void |
updatePlayerExploredTiles()
Updates the PlayerExploredTile for each player. |
void |
updatePlayerExploredTiles(Player oldPlayer)
Updates the PlayerExploredTile for each player. |
| Methods inherited from class net.sf.freecol.common.model.UnitLocation |
|---|
disposeList, getGoodsContainer, getNoAddReason, getSpaceTaken, getUnitCapacity, getUnitCount, getUnitIterator, getUnitList, isEmpty, isFull, writeAttributes, writeChildren |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObject |
|---|
equals, equals, fundamentalDispose, getFreeColGameObject, getFreeColGameObject, getGame, getIntegerID, getSpecification, hashCode, isDisposed, isUninitialized, newLocation, readFromXML, readFromXMLPartialByClass, setDefaultId, setGame, setId, toXML, toXMLImpl, toXMLPartialByClass, updateFreeColGameObject |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.freecol.common.model.Location |
|---|
getId |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
public static final java.lang.String UNIT_CHANGE
public static final int NEAR_RADIUS
getLocationName(),
Constant Field Valuesprivate TileType type
private int x
private int y
private Player owner
private Settlement settlement
private TileItemContainer tileItemContainer
private Settlement owningSettlement
private java.util.Map<Player,PlayerExploredTile> playerExploredTiles
private Region region
private boolean connected
private java.lang.Boolean moveToEurope
private int style
| Constructor Detail |
|---|
public Tile(Game game,
TileType type,
int locX,
int locY)
game - The Game this Tile belongs to.type - The type.locX - The x-position of this tile on the map.locY - The y-position of this tile on the map.
public Tile(Game game,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
game - The Game this Tile should be
created in.in - The input stream containing the XML.
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.
public Tile(Game game,
java.lang.String id)
Tile with the given ID. The object should
later be initialized by calling either
FreeColGameObject.readFromXML(XMLStreamReader).
game - The Game in which this object belong.id - The unique identifier for this object.| Method Detail |
|---|
public Tile getScratchTile()
public void disposeScratchTile()
public boolean isViewShared()
public Region getRegion()
Region value.
Region valuepublic void setRegion(Region newRegion)
Region value.
newRegion - The new Region value.public Region getDiscoverableRegion()
null if there is none.
Region valuepublic java.lang.String getNameKey()
getNameKey in interface NamedString.public StringTemplate getLabel()
Tile, with the name of the tile
and any improvements on it (road/plow/etc) from TileItemContainer.
public StringTemplate getLocationName()
getLocationName in interface LocationgetLocationName in class UnitLocationpublic StringTemplate getLocationNameFor(Player player)
getLocationNameFor in interface LocationgetLocationNameFor in class UnitLocationplayer - The Player to prepare the location name for.
public int getStyle()
Style value.
int valuepublic void setStyle(int newStyle)
Style value.
newStyle - The new Style value.
public static boolean isSameTile(Location l1,
Location l2)
l1 - The first Location.l2 - The second Location.
public int getDistanceTo(Tile tile)
Tile and the
specified one.
tile - The Tile to check the distance to.
public Map.Direction getDirection(Tile tile)
tile - The other Tile.
public TileItemContainer getTileItemContainer()
TileItemContainer.
TileItemContainer valuepublic void setTileItemContainer(TileItemContainer newTileItemContainer)
TileItemContainer.
newTileItemContainer - a TileItemContainer valuepublic java.util.List<TileImprovement> getTileImprovements()
TileImprovements.
TileImprovementspublic java.util.List<TileImprovement> getCompletedTileImprovements()
TileImprovements.
TileImprovementspublic Unit getDefendingUnit(Unit attacker)
Unit that is currently defending this
Tile.
If this tile has a settlement, the units inside the settlement are also considered as potential defenders.
As this method is quite expensive, it should not be used to test for the presence of enemy units.
attacker - The target that would be attacking this tile.
Unit that has been chosen to defend this
tile.public void dispose()
UnitLocation
dispose in class UnitLocationpublic Unit getFirstUnit()
Unit on this tile.
Unit on this tile.public Unit getLastUnit()
Unit on this tile.
Unit on this tile.public int getTotalUnitCount()
public boolean contains(Locatable locatable)
Tile contains the specified
Locatable.
contains in interface Locationcontains in class UnitLocationlocatable - The Locatable to test the presence of.
Locatable is
on this Tile and
public Map getMap()
Map in which this Tile belongs.
Map.public boolean isConnected()
boolean valuepublic void setConnected(boolean newConnected)
Connected value.
newConnected - The new Connected value.public java.lang.Boolean getMoveToEurope()
public void setMoveToEurope(java.lang.Boolean moveToEurope)
moveToEurope - The new move-to-Europe state for the tile.public boolean canMoveToEurope()
public boolean isExplored()
public boolean isPolar()
public boolean isLand()
true if this Tile is a land Tile, 'false' otherwise.
true if this Tile is a land Tile, 'false' otherwise.public boolean isForested()
true if this Tile is forested.
true if this Tile is forested.public boolean hasRiver()
true if this Tile has a River.
true if this Tile has a River.public boolean hasResource()
true if this Tile has a resource on it.
true if this Tile has a resource on it.public boolean hasLostCityRumour()
true if this Tile has a lostCityRumour on it.
true if this Tile has a lostCityRumour on it.public boolean hasRoad()
true if this Tile has a road.
true if this Tile has a road.public TileImprovement getRoad()
null otherwise.
TileImprovement valuepublic TileType getType()
public Player getOwner()
getOwner in interface Ownablepublic void setOwner(Player owner)
setOwner in interface Ownableowner - The player, new owner of this tile.getOwner()public void setSettlement(Settlement s)
Settlement on this Tile. A
Tile can only have one Settlement located
on it. The Settlement will also become the owner of this
Tile.
s - The Settlement that shall be located on this
Tile.getSettlement()public Settlement getSettlement()
Settlement located on this Tile.
getSettlement in interface LocationgetSettlement in class UnitLocationSettlement that is located on this
Tile or null if no Settlement
apply.setSettlement(net.sf.freecol.common.model.Settlement)public Colony getColony()
Colony located on this Tile. Only
a convenience method for getSettlement() that makes sure that
the settlement is a colony.
getColony in interface LocationgetColony in class UnitLocationColony that is located on this
Tile or null if none found.getSettlement()public IndianSettlement getIndianSettlement()
IndianSettlement located on this
Tile. Only a convenience method for getSettlement() that makes sure that the settlement is a native
settlement.
IndianSettlement that is located on this
Tile or null if none found.getSettlement()public Settlement getOwningSettlement()
Settlement that owns this tile.setOwner(net.sf.freecol.common.model.Player)public void setOwningSettlement(Settlement owner)
owner - The Settlement to own this tile.getOwner()public void changeOwningSettlement(Settlement settlement)
settlement - The new owning Settlement for this tile.
public void changeOwnership(Player player,
Settlement settlement)
player - The Player to own the tile.settlement - The Settlement to own the tile.public boolean isInUse()
private void addTileItem(TileItem item)
item - The TileItem to add.public LostCityRumour getLostCityRumour()
Tile if any.
LostCityRumour on this tile, or null if none.public void addLostCityRumour(LostCityRumour rumour)
rumour - The LostCityRumour to add.public void removeLostCityRumour()
Tile if there
is one.
public TileImprovement getRiver()
Tile if any
TileImprovementpublic int getRiverStyle()
TileImprovement on this Tile.
int valuepublic Tile getNeighbourOrNull(Map.Direction direction)
direction - The direction in which the neighbour tile is located.
public boolean hasUnexploredAdjacent()
public boolean isCoast()
boolean valuepublic void addResource(Resource resource)
Resource to this Tile.
resource - The Resource to add.public void setType(TileType t)
t - The new TileType for this Tile.public int getX()
public int getY()
public Map.Position getPosition()
Position of this Tile.
Position of this Tile.
public void setPosition(int x,
int y)
public Unit getMovableUnit()
Unit that can become active. This is preferably a
Unit not currently performing any work.
Unit with movesLeft > 0 or
null if no such Unit is located on this
Tile.public Tile getTile()
Tile where this Location is
located or null if no Tile applies.
getTile in interface LocationgetTile in class UnitLocationTile.public boolean add(Locatable locatable)
Locatable to this Location.
add in interface Locationadd in class UnitLocationlocatable - The Locatable to add to this Location.public boolean remove(Locatable locatable)
Locatable from this Location.
remove in interface Locationremove in class UnitLocationlocatable - The Locatable to remove from this
Location.public boolean canAdd(Locatable locatable)
Location.
canAdd in interface LocationcanAdd in class UnitLocationlocatable - a Locatable value
boolean value
public int potential(GoodsType goodsType,
UnitType unitType)
goodsType - The type of goods to check the potential for.unitType - an UnitType value
public int getMaximumPotential(GoodsType goodsType,
UnitType unitType)
goodsType - The type of goods.unitType - an UnitType value
public java.util.Set<Modifier> getProductionBonus(GoodsType goodsType,
UnitType unitType)
getProductionBonus method here.
goodsType - a GoodsType value
Modifier valuepublic boolean canGetRoad()
Tile can have a road or not. This
method will return false if a road has already been built.
public TileImprovement findTileImprovementType(TileImprovementType type)
public boolean hasImprovement(TileImprovementType type)
type - The type to check for.
public static int getTileTypePotential(TileType tileType,
GoodsType goodsType,
TileItemContainer tiContainer,
UnitType unitType)
GoodsType.
tileType - The TileType.goodsType - The GoodsType to check the potential for.tiContainer - The TileItemContainer with any TileItems to
give bonuses.unitType - an UnitType value
The Bonus Fish to be considered if valid
public java.util.List<AbstractGoods> getSortedPotential()
public java.util.List<AbstractGoods> getSortedPotential(Unit unit)
unit - the Unit to work on this Tile
public java.util.List<AbstractGoods> getSortedPotential(UnitType unitType,
Player owner)
unitType - the UnitType to work on this Tileowner - the Player owning the unit
public Resource expendResource(GoodsType goodsType,
UnitType unitType,
Settlement settlement)
Resource
that is on the tile, if any and if applicable.
ResourceTypepublic void updatePlayerExploredTiles()
PlayerExploredTile for each player. This
update will only be performed if the player
can see this Tile.
public void updatePlayerExploredTiles(Player oldPlayer)
PlayerExploredTile for each player. This
update will only be performed if the player
can see this Tile.
oldPlayer - The optional Player that formerly
had visibility of this tile and should see the change.public PlayerExploredTile getPlayerExploredTile(Player player)
PlayerExploredTile for the given
Player.
player - The Player.PlayerExploredTile
public void updatePlayerExploredTile(Player player,
boolean full)
Tile for the given
Player.
player - The Player.full - If true, also update any hidden information specific to a
settlement present on the tile.public boolean isExploredBy(Player player)
Tile has been explored by the given
Player.
player - The Player.
true if this Tile has been explored
by the given Player and false
otherwise.
public void setExploredBy(Player player,
boolean explored)
Tile to be explored by the given
Player.
player - The Player.explored - true if this Tile should be
explored by the given Player and
false otherwise.public int getWorkAmount(TileImprovementType workType)
TileImprovementType. It will check if it is valid
for this TileType.
workType - The TileImprovementType
public Unit getOccupyingUnit()
isOccupied()public boolean isOccupied()
true if an fortified enemy unit is in the tilepublic boolean isAdjacent(Tile tile)
tile - A potentially adjacent Tile.
true if the tile is adjacent to this tilepublic Tile getAdjacentTile(Map.Direction direction)
direction - The direction (N, NE, E, etc.)
public java.lang.Iterable<Tile> getSurroundingTiles(int range)
range - How far away do we need to go starting from this.
public java.util.List<Tile> getSurroundingTiles(int rangeMin,
int rangeMax)
rangeMin - The inclusive minimum distance from this tile.rangeMax - The inclusive maximum distance from this tile.
public boolean isAdjacentToVerticalMapEdge()
Tile is adjacent to the
east or west edge of the map.
true if the given tile is at the edge of the map.public boolean isAdjacentToMapEdge()
Tile is adjacent to the edge of the
map.
true if the given tile is at the edge of the map.
public Settlement getNearestSettlement(Player owner,
int radius)
owner - If non-null, the settlement should be owned by this player.radius - The maximum radius of the search.
public Tile getSafeTile(Player player,
java.util.Random random)
player - The owner of the unit to place (may be null).random - An optional pseudo-random number source.
public void toXMLMinimal(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
out - The target stream.
javax.xml.stream.XMLStreamException
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out,
Player player,
boolean showAll,
boolean toSavedGame)
throws javax.xml.stream.XMLStreamException
Player will be added
to that representation if showAll is set to
false.
toXMLImpl in class FreeColGameObjectout - The target stream.player - The Player this XML-representation should be
made for, or null if
showAll == true.showAll - Only attributes visible to player will be
added to the representation if showAll is set
to false.toSavedGame - If true then information that is only
needed when saving a game is added.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
protected void readAttributes(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readAttributes in class FreeColObjectin - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChildren(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChildren in class UnitLocationin - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChild(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChild in class UnitLocationin - The XML input stream.
javax.xml.stream.XMLStreamException - if an error occurspublic void fixup09x()
public java.lang.String toString()
toString in class FreeColGameObjectpublic static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||