|
|||||||||
| 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.FreeColGameObjectType
net.sf.freecol.common.model.TileImprovementType
public final class TileImprovementType
| Field Summary | |
|---|---|
private int |
addWorkTurns
|
private java.util.Set<java.lang.String> |
allowedWorkers
|
private int |
deliverAmount
|
private GoodsType |
deliverGoodsType
|
private int |
expendedAmount
|
private EquipmentType |
expendedEquipmentType
|
private int |
exposeResourcePercent
Can this improvement expose a resource when completed? This should only apply to improvement types that change the underlying tile type (e.g. |
private int |
magnitude
|
private int |
movementCost
|
private float |
movementCostFactor
|
private boolean |
natural
|
private TileImprovementType |
requiredImprovementType
|
private java.util.List<Scope> |
scopes
The scopes define which TileTypes support this improvement. |
private java.util.Map<TileType,TileTypeChange> |
tileTypeChanges
|
private int |
zIndex
The layer a TileItem belongs to. |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, logger, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
TileImprovementType(java.lang.String id,
Specification specification)
|
|
| Method Summary | |
|---|---|
boolean |
changeContainsTarget(TileType tileType)
Returns true if this TileImprovementType can change a tile type to the given tile type. |
int |
getAddWorkTurns()
|
int |
getBonus(GoodsType goodsType)
|
TileType |
getChange(TileType tileType)
Returns the destination type of a tile type change (or null). |
int |
getExpendedAmount()
|
EquipmentType |
getExpendedEquipmentType()
|
int |
getExposeResourcePercent()
Gets the percent chance that this tile improvement can expose a resource on the tile. |
int |
getImprovementValue(Tile tile,
GoodsType goodsType)
Gets the increase in production of the given GoodsType this tile improvement type would yield at a specified tile. |
int |
getMagnitude()
|
int |
getMovementCost(int moveCost)
Performs reduction of the movement-cost. |
AbstractGoods |
getProduction(TileType from)
Returns the goods produced by applying this TileImprovementType to a Tile with the given TileType. |
Modifier |
getProductionModifier(GoodsType goodsType)
|
TileImprovementType |
getRequiredImprovementType()
|
java.util.List<Scope> |
getScopes()
Get the Scopes value. |
java.lang.String |
getShortId()
Return an ID of an appropriate action. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
int |
getZIndex()
Get the ZIndex value. |
boolean |
isChangeType()
Returns true if this TileImprovementType changes the underlying tile type. |
boolean |
isNatural()
|
boolean |
isTileAllowed(Tile tile)
Check if a given Tile is valid for this TileImprovement. |
boolean |
isTileTypeAllowed(TileType tileType)
This will check if in principle this type of improvement can be used on this kind of tile, disregarding the current state of an actual tile. |
boolean |
isWorkerAllowed(Unit unit)
Check if a given Unit can perform this TileImprovement. |
boolean |
isWorkerTypeAllowed(UnitType unitType)
|
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 child object. |
void |
setZIndex(int newZIndex)
Set the ZIndex value. |
void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the attributes of this object to a stream. |
protected void |
writeChildren(javax.xml.stream.XMLStreamWriter out)
Write the children of this object to a stream. |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType |
|---|
addAbility, addModifier, applyDifficultyLevel, getDescriptionKey, getFeatureContainer, getIndex, getModifierIndex, getModifierIndex, getModifierSet, getNameKey, hasAbility, hasAbility, isAbstractType, readChildren, setAbstractType, setFeatureContainer, setIndex, setModifierIndex, toString, toXMLImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private boolean natural
private int magnitude
private int addWorkTurns
private TileImprovementType requiredImprovementType
private java.util.Set<java.lang.String> allowedWorkers
private EquipmentType expendedEquipmentType
private int expendedAmount
private GoodsType deliverGoodsType
private int deliverAmount
private java.util.Map<TileType,TileTypeChange> tileTypeChanges
private int movementCost
private float movementCostFactor
private int zIndex
private int exposeResourcePercent
private java.util.List<Scope> scopes
| Constructor Detail |
|---|
public TileImprovementType(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public boolean isNatural()
public int getMagnitude()
public int getAddWorkTurns()
public int getZIndex()
ZIndex value.
int valuepublic void setZIndex(int newZIndex)
ZIndex value.
newZIndex - The new ZIndex value.public TileImprovementType getRequiredImprovementType()
public EquipmentType getExpendedEquipmentType()
public int getExpendedAmount()
public AbstractGoods getProduction(TileType from)
from - a TileType value
AbstractGoods valuepublic java.util.List<Scope> getScopes()
Scopes value.
List valuepublic java.lang.String getShortId()
String valuepublic boolean isWorkerTypeAllowed(UnitType unitType)
public boolean isWorkerAllowed(Unit unit)
Unit can perform this TileImprovement.
public boolean isTileTypeAllowed(TileType tileType)
isTileAllowed(Tile).
tileType - The type of terrain
public boolean isTileAllowed(Tile tile)
Tile is valid for this TileImprovement.
public int getBonus(GoodsType goodsType)
public Modifier getProductionModifier(GoodsType goodsType)
public boolean isChangeType()
boolean valuepublic TileType getChange(TileType tileType)
tileType - a TileType value
TileType valuepublic boolean changeContainsTarget(TileType tileType)
tileType - a TileType value
boolean valuepublic int getMovementCost(int moveCost)
moveCost - Original movement cost
public int getExposeResourcePercent()
public int getImprovementValue(Tile tile,
GoodsType goodsType)
tile - The Tile to be considered.goodsType - A preferred GoodsType or null
public void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColGameObjectTypeout - The output stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to
the stream.
protected void writeChildren(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeChildren in class FreeColGameObjectTypeout - The target stream.
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 FreeColGameObjectTypein - 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 FreeColGameObjectTypein - The XML stream to read.
javax.xml.stream.XMLStreamException - if an error occurspublic static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||