|
|||||||||
| 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 | |
|---|---|
private int |
colonyStockadeLevel
|
private int |
colonyUnitCount
|
private boolean |
connected
|
private boolean |
explored
|
private java.util.List<TileImprovement> |
improvements
|
private static java.util.logging.Logger |
logger
|
private LostCityRumour |
lostCityRumour
|
private Unit |
missionary
|
private Player |
owner
The owner of this tile. |
private Player |
player
The owner of this view. |
private Resource |
resource
|
private TileImprovement |
river
|
private TileImprovement |
road
|
private boolean |
settlementVisited
|
private UnitType |
skill
|
private Tile |
tile
|
private GoodsType[] |
wantedGoods
|
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE |
| 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 |
|---|
addModelMessage, addModelMessage, addModelMessage, addToRemoveElement, dispose, equals, equals, getFreeColGameObject, getFreeColGameObject, getGame, getGameOptions, getIntegerID, hashCode, hasID, isDisposed, isUninitialized, readFromXML, readFromXMLPartialByClass, setFakeID, setGame, setId, toSavedXML, toString, toXML, toXMLImpl, toXMLPartialByClass, updateFreeColGameObject, updateID |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private Player player
private boolean explored
private Player owner
private Resource resource
private LostCityRumour lostCityRumour
private java.util.List<TileImprovement> improvements
private TileImprovement road
private TileImprovement river
private int colonyUnitCount
private int colonyStockadeLevel
private UnitType skill
private GoodsType[] wantedGoods
private boolean settlementVisited
private Unit missionary
private boolean connected
private Tile tile
| Constructor Detail |
|---|
public PlayerExploredTile(Game game,
Player player,
Tile tile)
PlayerExploredTile.
player - the playertile - a tile
public 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.
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.
public void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readFromXMLImpl in class FreeColObjectin - 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 | ||||||||