|
||||||||||
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.PlayerExploredTile
public class PlayerExploredTile
This class contains the mutable tile data visible to a specific player.
Sometimes a tile contains information that should not be given to a
player. For instance; a settlement that was built after the player last
viewed the tile.
The toXMLElement
of Tile
uses information from
this class to hide information that is not available.
Field Summary |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
PlayerExploredTile(Game game,
Player player,
Tile tile)
Creates a new PlayerExploredTile . |
|
PlayerExploredTile(Game game,
javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
Method Summary | |
---|---|
int |
getColonyStockadeLevel()
|
int |
getColonyUnitCount()
|
java.util.List<TileImprovement> |
getImprovements()
|
LostCityRumour |
getLostCityRumour()
|
Unit |
getMissionary()
|
Player |
getOwner()
|
Player |
getPlayer()
Gets the Player owning this object (not the Tile). |
Resource |
getResource()
|
TileImprovement |
getRiver()
|
TileImprovement |
getRoad()
|
UnitType |
getSkill()
|
void |
getTileItemInfo(TileItemContainer tic)
Copies given TileItemContainer |
GoodsType[] |
getWantedGoods()
|
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
boolean |
hasBeenVisited()
|
boolean |
hasLostCityRumour()
|
boolean |
hasRiver()
|
boolean |
hasRoad()
|
boolean |
isConnected()
|
boolean |
isExplored()
Checks if this Tile has been explored. |
void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setColonyStockadeLevel(int colonyStockadeLevel)
|
void |
setColonyUnitCount(int colonyUnitCount)
|
void |
setConnected(boolean connected)
|
void |
setExplored(boolean explored)
|
void |
setLostCityRumour(LostCityRumour lostCityRumour)
|
void |
setMissionary(Unit missionary)
|
void |
setOwner(Player owner)
|
void |
setSkill(UnitType newSkill)
|
void |
setVisited()
|
void |
setWantedGoods(GoodsType[] newWantedGoods)
|
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. |
Methods inherited from class net.sf.freecol.common.model.FreeColGameObject |
---|
addToRemoveElement, dispose, equals, equals, getFreeColGameObject, getFreeColGameObject, getGame, getGameOptions, getIntegerID, hashCode, hasID, isDisposed, isUninitialized, readFromXML, setGame, setId, toSavedXML, toString, toXML, updateFreeColGameObject, updateID |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PlayerExploredTile(Game game, Player player, Tile tile)
PlayerExploredTile
.
player
- the playertile
- a tilepublic PlayerExploredTile(Game game, javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
in
- The XML stream to read the data from.
javax.xml.stream.XMLStreamException
- if an error occurred during parsing.Method Detail |
---|
public void getTileItemInfo(TileItemContainer tic)
tic
- The TileItemContainer
to copy frompublic void setColonyUnitCount(int colonyUnitCount)
public int getColonyUnitCount()
public void setColonyStockadeLevel(int colonyStockadeLevel)
public int getColonyStockadeLevel()
public boolean hasRoad()
public TileImprovement getRoad()
public boolean hasRiver()
public TileImprovement getRiver()
public Resource getResource()
public LostCityRumour getLostCityRumour()
public java.util.List<TileImprovement> getImprovements()
public void setLostCityRumour(LostCityRumour lostCityRumour)
public boolean hasLostCityRumour()
public void setConnected(boolean connected)
public boolean isConnected()
public void setExplored(boolean explored)
public boolean isExplored()
Tile
has been explored.
public void setSkill(UnitType newSkill)
public UnitType getSkill()
public void setOwner(Player owner)
public Player getOwner()
public void setWantedGoods(GoodsType[] newWantedGoods)
public GoodsType[] getWantedGoods()
public void setMissionary(Unit missionary)
public Unit getMissionary()
public void setVisited()
public boolean hasBeenVisited()
public Player getPlayer()
PlayerExploredTile
.public 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
.
out
- 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.public void readFromXMLImpl(javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
in
- The input stream with the XML.
javax.xml.stream.XMLStreamException
- if an error occurred during parsing.public static java.lang.String getXMLElementTagName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |