net.sf.freecol.common.model
Class TileType

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.FreeColGameObjectType
          extended by net.sf.freecol.common.model.TileType

public final class TileType
extends FreeColGameObjectType


Nested Class Summary
static class TileType.RangeType
           
 
Field Summary
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
TileType(int index)
           
 
Method Summary
 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()
           
 java.lang.String getArtBasic()
           
 java.lang.String getArtCoast()
           
 java.lang.String getArtForest()
           
 java.lang.String getArtOverlay()
           
 int getBasicMoveCost()
           
 int getBasicWorkTurns()
           
 java.util.Set<Modifier> getDefenceBonus()
           
 java.awt.Color getMinimapColor()
           
 java.util.List<AbstractGoods> getProduction()
          Get the Production value.
 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()
           
 GoodsType getSecondaryGoods()
           
 java.util.List<RandomChoice<ResourceType>> getWeightedResources()
           
 boolean isConnected()
          Get the Connected value.
 boolean isForested()
           
 boolean isWater()
           
 void readAttributes(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void readChildren(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 boolean withinRange(TileType.RangeType rangeType, int value)
           
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType
addAbility, addModifier, getFeatureContainer, getIndex, getModifierSet, hasAbility, hasAbility, readFromXML, setFeatureContainer, setIndex, toString
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getXMLElementTagName, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TileType

public TileType(int index)
Method Detail

getArtBasic

public java.lang.String getArtBasic()

getArtOverlay

public java.lang.String getArtOverlay()

getArtForest

public java.lang.String getArtForest()

getArtCoast

public java.lang.String getArtCoast()

getMinimapColor

public java.awt.Color getMinimapColor()

isForested

public boolean isForested()

isWater

public boolean isWater()

isConnected

public boolean isConnected()
Get the Connected value.

Returns:
a boolean value

canSettle

public boolean canSettle()

canHaveImprovement

public boolean canHaveImprovement(TileImprovementType improvement)
Returns true if this TileType supports the given TileImprovementType.

Parameters:
improvement - a TileImprovementType value
Returns:
a boolean value

getBasicMoveCost

public int getBasicMoveCost()

getBasicWorkTurns

public int getBasicWorkTurns()

getDefenceBonus

public java.util.Set<Modifier> getDefenceBonus()

getProductionOf

public int getProductionOf(GoodsType goodsType,
                           UnitType unitType)
Returns the amount of goods of given GoodsType this TileType can produce. This method applies the production bonus to 0f. Thus, it will always return 0 unless an additive modifier is present. This is intentional.

Parameters:
goodsType - a GoodsType value
unitType - an UnitType value
Returns:
an int value
See Also:
getProductionBonus(GoodsType)

getProductionBonus

public java.util.Set<Modifier> getProductionBonus(GoodsType goodsType)
Returns the production bonus for the given GoodsType.

Parameters:
goodsType - a GoodsType value
Returns:
a Modifier value

getSecondaryGoods

public GoodsType getSecondaryGoods()

getProduction

public java.util.List<AbstractGoods> getProduction()
Get the Production value.

Returns:
a List value

getWeightedResources

public java.util.List<RandomChoice<ResourceType>> getWeightedResources()

getResourceTypeList

public java.util.List<ResourceType> getResourceTypeList()

canHaveResourceType

public boolean canHaveResourceType(ResourceType resourceType)
Can this TileType contain a specified ResourceType?

Parameters:
resourceType - a ResourceType to test
Returns:
Whether this TileType contains the specified ResourceType

withinRange

public boolean withinRange(TileType.RangeType rangeType,
                           int value)

readAttributes

public void readAttributes(javax.xml.stream.XMLStreamReader in,
                           Specification specification)
                    throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

readChildren

public void readChildren(javax.xml.stream.XMLStreamReader in,
                         Specification specification)
                  throws javax.xml.stream.XMLStreamException
Overrides:
readChildren in class FreeColGameObjectType
Throws:
javax.xml.stream.XMLStreamException