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
private  int[] altitude
           
private  java.lang.String artBasic
           
private  java.lang.String artCoast
           
private  java.lang.String artForest
           
private  java.lang.String artOverlay
           
private  int basicMoveCost
           
private  int basicWorkTurns
           
private  boolean canSettle
           
private  boolean connected
          Whether this TileType is connected to Europe.
private  boolean forest
           
private  int[] humidity
           
private  java.awt.Color minimapColor
           
private  java.util.List<AbstractGoods> production
          Describe production here.
private  java.util.List<RandomChoice<ResourceType>> resourceType
           
private  GoodsType secondaryGoods
           
private  int[] temperature
           
private  boolean water
           
 
Fields inherited from class net.sf.freecol.common.model.FreeColGameObjectType
featureContainer
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE
 
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, readChild, readFromXML, readFromXMLImpl, setFeatureContainer, setIndex, toString, toXMLImpl
 
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, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

artBasic

private java.lang.String artBasic

artOverlay

private java.lang.String artOverlay

artForest

private java.lang.String artForest

artCoast

private java.lang.String artCoast

minimapColor

private java.awt.Color minimapColor

forest

private boolean forest

water

private boolean water

canSettle

private boolean canSettle

basicMoveCost

private int basicMoveCost

basicWorkTurns

private int basicWorkTurns

humidity

private int[] humidity

temperature

private int[] temperature

altitude

private int[] altitude

resourceType

private java.util.List<RandomChoice<ResourceType>> resourceType

secondaryGoods

private GoodsType secondaryGoods

connected

private boolean connected
Whether this TileType is connected to Europe.


production

private java.util.List<AbstractGoods> production
Describe production here.

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
Overrides:
readAttributes in class FreeColGameObjectType
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