jfreerails.world.terrain
Class TileTypeImpl

java.lang.Object
  extended by jfreerails.world.terrain.TileTypeImpl
All Implemented Interfaces:
java.io.Serializable, FreerailsSerializable, TerrainType

public final class TileTypeImpl
extends java.lang.Object
implements TerrainType

Represents a type of terrain.

Author:
Luke Lindsay 16 August 2001
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jfreerails.world.terrain.TerrainType
TerrainType.Category
 
Field Summary
private  ImList<Consumption> consumption
           
private  ImList<Conversion> conversion
           
private  ImList<Production> production
           
private  int rgb
           
private  int rightOfWay
           
private static long serialVersionUID
           
private  TerrainType.Category terrainCategory
           
private  java.lang.String terrainType
           
private  Money tileBuildCost
          Cost to build a tile of this terrain type or null if this type is not buildable.
 
Constructor Summary
TileTypeImpl(int rgb, TerrainType.Category terrainCategory, java.lang.String terrainType, int rightOfWay, Production[] production, Consumption[] consumption, Conversion[] conversion, int tileBuildCost)
           
TileTypeImpl(TerrainType.Category terrainCategory, java.lang.String terrainType)
          Lets unit tests create terrain types without bothering with all the details.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Money getBuildCost()
           
 TerrainType.Category getCategory()
           
 ImList<Consumption> getConsumption()
           
 ImList<Conversion> getConversion()
           
 java.lang.String getDisplayName()
          Returns the name, replacing any underscores with spaces.
 ImList<Production> getProduction()
           
 int getRGB()
           
 int getRightOfWay()
           
 java.lang.String getTerrainTypeName()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

consumption

private final ImList<Consumption> consumption

conversion

private final ImList<Conversion> conversion

production

private final ImList<Production> production

rgb

private final int rgb

rightOfWay

private final int rightOfWay

terrainCategory

private final TerrainType.Category terrainCategory

terrainType

private final java.lang.String terrainType

tileBuildCost

private final Money tileBuildCost
Cost to build a tile of this terrain type or null if this type is not buildable.

Constructor Detail

TileTypeImpl

public TileTypeImpl(int rgb,
                    TerrainType.Category terrainCategory,
                    java.lang.String terrainType,
                    int rightOfWay,
                    Production[] production,
                    Consumption[] consumption,
                    Conversion[] conversion,
                    int tileBuildCost)

TileTypeImpl

public TileTypeImpl(TerrainType.Category terrainCategory,
                    java.lang.String terrainType)
Lets unit tests create terrain types without bothering with all the details.

Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getBuildCost

public Money getBuildCost()
Specified by:
getBuildCost in interface TerrainType

getCategory

public TerrainType.Category getCategory()
Specified by:
getCategory in interface TerrainType

getConsumption

public ImList<Consumption> getConsumption()
Specified by:
getConsumption in interface TerrainType

getConversion

public ImList<Conversion> getConversion()
Specified by:
getConversion in interface TerrainType

getDisplayName

public java.lang.String getDisplayName()
Returns the name, replacing any underscores with spaces.

Specified by:
getDisplayName in interface TerrainType

getProduction

public ImList<Production> getProduction()
Specified by:
getProduction in interface TerrainType

getRGB

public int getRGB()
Specified by:
getRGB in interface TerrainType
Returns:
The RGB value mapped to this terrain type.

getRightOfWay

public int getRightOfWay()
Specified by:
getRightOfWay in interface TerrainType

getTerrainTypeName

public java.lang.String getTerrainTypeName()
Specified by:
getTerrainTypeName in interface TerrainType