|
|||||||||
| 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.TileType
public final class TileType
| Nested Class Summary | |
|---|---|
static class |
TileType.RangeType
|
| Field Summary | |
|---|---|
private int[] |
altitude
|
private int |
basicMoveCost
|
private int |
basicWorkTurns
|
private boolean |
canSettle
|
private boolean |
connected
Whether this TileType is connected to Europe. |
private boolean |
elevation
|
private boolean |
forest
|
private int[] |
humidity
|
private AbstractGoods |
primaryGoods
The primary goods produced by this tile type. |
private java.util.Map<java.lang.String,AbstractGoods> |
primaryGoodsMap
|
private java.util.List<AbstractGoods> |
production
A list of AbstractGoods produced by this TileType when it is not the colony center tile. |
private java.util.Map<java.lang.String,java.util.Map<GoodsType,AbstractGoods>> |
productionMap
|
private java.util.List<RandomChoice<ResourceType>> |
resourceType
|
private AbstractGoods |
secondaryGoods
The secondary goods produced by this tile type. |
private java.util.Map<java.lang.String,AbstractGoods> |
secondaryGoodsMap
|
private int[] |
temperature
|
private boolean |
water
|
| 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 | |
|---|---|
TileType(java.lang.String id,
Specification specification)
|
|
| Method Summary | |
|---|---|
void |
applyDifficultyLevel(OptionGroup difficultyLevel)
Applies the difficulty level to this TileType. |
boolean |
canHaveImprovement(TileImprovementType improvement)
Returns true if this TileType supports the given TileImprovementType. |
boolean |
canHaveResourceType(ResourceType resourceType)
Can this TileType contain a specified ResourceType? |
boolean |
canSettle()
|
int |
getBasicMoveCost()
|
int |
getBasicWorkTurns()
|
java.util.Set<Modifier> |
getDefenceBonus()
|
int |
getIndex()
Returns the index of this FreeColGameObjectType. |
AbstractGoods |
getPrimaryGoods()
Get the PrimaryGoods value. |
AbstractGoods |
getPrimaryGoods(java.lang.String tileProduction)
Get the PrimaryGoods value at the tileProduction level
with the ID given. |
java.util.List<AbstractGoods> |
getProduction()
Returns a list of all types of AbstractGoods produced by this TileType when it is not the colony center tile. |
java.util.List<AbstractGoods> |
getProduction(java.lang.String tileProduction)
Returns a list of all types of AbstractGoods produced by this TileType when it is not the colony center tile. |
java.util.Set<Modifier> |
getProductionBonus(GoodsType goodsType)
Returns the production bonus for the given GoodsType. |
int |
getProductionOf(GoodsType goodsType,
UnitType unitType)
Returns the amount of goods of given GoodsType this TileType can produce. |
java.util.List<ResourceType> |
getResourceTypeList()
|
AbstractGoods |
getSecondaryGoods()
Get the SecondaryGoods value. |
AbstractGoods |
getSecondaryGoods(java.lang.String tileProduction)
Get the SecondaryGoods value at the tileProduction level
with the ID given. |
java.util.List<RandomChoice<ResourceType>> |
getWeightedResources()
|
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
boolean |
isConnected()
Get the Connected value. |
boolean |
isElevation()
Is this tile an elevation. |
boolean |
isForested()
|
boolean |
isPrimaryGoodsType(GoodsType type)
Returns true if the given GoodsType is the primary
goods type of this TileType. |
boolean |
isSecondaryGoodsType(GoodsType type)
Returns true if the given GoodsType is the secondary
goods type of this TileType. |
boolean |
isWater()
|
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 |
setPrimaryGoods(AbstractGoods newPrimaryGoods)
Set the PrimaryGoods value. |
void |
setSecondaryGoods(AbstractGoods newSecondaryGoods)
Set the SecondaryGoods value. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
boolean |
withinRange(TileType.RangeType rangeType,
int value)
|
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, getDescriptionKey, getFeatureContainer, 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 forest
private boolean water
private boolean canSettle
private boolean elevation
private int basicMoveCost
private int basicWorkTurns
private int[] humidity
private int[] temperature
private int[] altitude
private java.util.List<RandomChoice<ResourceType>> resourceType
private boolean connected
private AbstractGoods primaryGoods
private AbstractGoods secondaryGoods
private java.util.List<AbstractGoods> production
private java.util.Map<java.lang.String,AbstractGoods> primaryGoodsMap
private java.util.Map<java.lang.String,AbstractGoods> secondaryGoodsMap
private java.util.Map<java.lang.String,java.util.Map<GoodsType,AbstractGoods>> productionMap
| Constructor Detail |
|---|
public TileType(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public int getIndex()
getIndex in class FreeColGameObjectTypeint valuepublic boolean isForested()
public boolean isWater()
public boolean isConnected()
Connected value.
boolean valuepublic boolean isElevation()
public boolean canSettle()
public boolean canHaveImprovement(TileImprovementType improvement)
improvement - a TileImprovementType value
boolean valuepublic int getBasicMoveCost()
public int getBasicWorkTurns()
public java.util.Set<Modifier> getDefenceBonus()
public int getProductionOf(GoodsType goodsType,
UnitType unitType)
0f. Thus, it will always return 0
unless an additive modifier is present. This is intentional.
goodsType - a GoodsType valueunitType - an UnitType value
int valuegetProductionBonus(GoodsType)public java.util.Set<Modifier> getProductionBonus(GoodsType goodsType)
goodsType - a GoodsType value
Modifier valuepublic AbstractGoods getPrimaryGoods()
PrimaryGoods value.
AbstractGoods valuepublic AbstractGoods getPrimaryGoods(java.lang.String tileProduction)
PrimaryGoods value at the tileProduction level
with the ID given.
AbstractGoods valuepublic boolean isPrimaryGoodsType(GoodsType type)
GoodsType is the primary
goods type of this TileType.
type - a GoodsType value
boolean valuepublic void setPrimaryGoods(AbstractGoods newPrimaryGoods)
PrimaryGoods value.
newPrimaryGoods - The new PrimaryGoods value.public AbstractGoods getSecondaryGoods()
SecondaryGoods value.
AbstractGoods valuepublic AbstractGoods getSecondaryGoods(java.lang.String tileProduction)
SecondaryGoods value at the tileProduction level
with the ID given.
AbstractGoods valuepublic void setSecondaryGoods(AbstractGoods newSecondaryGoods)
SecondaryGoods value.
newSecondaryGoods - The new SecondaryGoods value.public boolean isSecondaryGoodsType(GoodsType type)
GoodsType is the secondary
goods type of this TileType.
type - a GoodsType value
boolean valuepublic java.util.List<AbstractGoods> getProduction()
List valuepublic java.util.List<AbstractGoods> getProduction(java.lang.String tileProduction)
tileProduction -
List valuepublic java.util.List<RandomChoice<ResourceType>> getWeightedResources()
public java.util.List<ResourceType> getResourceTypeList()
public boolean canHaveResourceType(ResourceType resourceType)
TileType contain a specified ResourceType?
resourceType - a ResourceType to test
TileType contains the specified ResourceType
public boolean withinRange(TileType.RangeType rangeType,
int value)
public void applyDifficultyLevel(OptionGroup difficultyLevel)
applyDifficultyLevel in class FreeColGameObjectTypedifficultyLevel - difficulty level to apply
protected 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 | ||||||||