megamek.common
Class Terrains

java.lang.Object
  extended by megamek.common.Terrains
All Implemented Interfaces:
ITerrainFactory

public class Terrains
extends java.lang.Object
implements ITerrainFactory


Field Summary
static int ARMS
           
static int BLDG_ARMOR
           
static int BLDG_BASEMENT
           
static int BLDG_CF
           
static int BLDG_CLASS
           
static int BLDG_ELEV
           
static int BRIDGE
           
static int BRIDGE_CF
           
static int BRIDGE_ELEV
           
static int BUILDING
           
static int ELEVATOR
           
static int FIELDS
           
static int FIRE
           
static int FLUFF
           
static int FORTIFIED
           
static int FUEL_TANK
           
static int FUEL_TANK_CF
           
static int FUEL_TANK_ELEV
           
static int FUEL_TANK_MAGN
           
static int GEYSER
           
static int ICE
           
static int IMPASSABLE
           
static int INDUSTRIAL
           
static int JUNGLE
           
static int LEGS
           
static int MAGMA
           
static int MUD
           
static int PAVEMENT
           
static int RAPIDS
           
static int ROAD
           
static int ROUGH
           
static int RUBBLE
           
static int SAND
           
static int SCREEN
           
static int SIZE
           
static int SMOKE
           
static int SNOW
           
static int SPACE
           
static int SWAMP
           
static int TUNDRA
           
static int WATER
           
static int WOODS
           
 
Constructor Summary
Terrains()
           
 
Method Summary
 ITerrain createTerrain(int type, int level)
          Create terrain of cpecified type and level
 ITerrain createTerrain(int type, int level, boolean exitsSpecified, int exits)
          Create terrain of cpecified type, level , exitsSpecified flag and exits,
 ITerrain createTerrain(ITerrain other)
          Create terrain as copy of other
 ITerrain createTerrain(java.lang.String terrain)
          Create Terrain using string containing terrain info TODO I think this shoul be removed.
static java.lang.String getDisplayName(int type, int level)
           
protected static java.util.Hashtable<java.lang.String,java.lang.Integer> getHash()
           
static java.lang.String getName(int type)
           
static int getTerrainFactor(int type, int level)
           
static ITerrainFactory getTerrainFactory()
           
static int getType(java.lang.String name)
          This function converts the name of a terrain into the constant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WOODS

public static final int WOODS
See Also:
Constant Field Values

WATER

public static final int WATER
See Also:
Constant Field Values

ROUGH

public static final int ROUGH
See Also:
Constant Field Values

RUBBLE

public static final int RUBBLE
See Also:
Constant Field Values

JUNGLE

public static final int JUNGLE
See Also:
Constant Field Values

SAND

public static final int SAND
See Also:
Constant Field Values

TUNDRA

public static final int TUNDRA
See Also:
Constant Field Values

MAGMA

public static final int MAGMA
See Also:
Constant Field Values

FIELDS

public static final int FIELDS
See Also:
Constant Field Values

INDUSTRIAL

public static final int INDUSTRIAL
See Also:
Constant Field Values

SPACE

public static final int SPACE
See Also:
Constant Field Values

PAVEMENT

public static final int PAVEMENT
See Also:
Constant Field Values

ROAD

public static final int ROAD
See Also:
Constant Field Values

SWAMP

public static final int SWAMP
See Also:
Constant Field Values

MUD

public static final int MUD
See Also:
Constant Field Values

RAPIDS

public static final int RAPIDS
See Also:
Constant Field Values

ICE

public static final int ICE
See Also:
Constant Field Values

SNOW

public static final int SNOW
See Also:
Constant Field Values

FIRE

public static final int FIRE
See Also:
Constant Field Values

SMOKE

public static final int SMOKE
See Also:
Constant Field Values

GEYSER

public static final int GEYSER
See Also:
Constant Field Values

BUILDING

public static final int BUILDING
See Also:
Constant Field Values

BLDG_CF

public static final int BLDG_CF
See Also:
Constant Field Values

BLDG_ELEV

public static final int BLDG_ELEV
See Also:
Constant Field Values

BLDG_BASEMENT

public static final int BLDG_BASEMENT
See Also:
Constant Field Values

BLDG_CLASS

public static final int BLDG_CLASS
See Also:
Constant Field Values

BLDG_ARMOR

public static final int BLDG_ARMOR
See Also:
Constant Field Values

BRIDGE

public static final int BRIDGE
See Also:
Constant Field Values

BRIDGE_CF

public static final int BRIDGE_CF
See Also:
Constant Field Values

BRIDGE_ELEV

public static final int BRIDGE_ELEV
See Also:
Constant Field Values

FUEL_TANK

public static final int FUEL_TANK
See Also:
Constant Field Values

FUEL_TANK_CF

public static final int FUEL_TANK_CF
See Also:
Constant Field Values

FUEL_TANK_ELEV

public static final int FUEL_TANK_ELEV
See Also:
Constant Field Values

FUEL_TANK_MAGN

public static final int FUEL_TANK_MAGN
See Also:
Constant Field Values

IMPASSABLE

public static final int IMPASSABLE
See Also:
Constant Field Values

ELEVATOR

public static final int ELEVATOR
See Also:
Constant Field Values

FORTIFIED

public static final int FORTIFIED
See Also:
Constant Field Values

SCREEN

public static final int SCREEN
See Also:
Constant Field Values

FLUFF

public static final int FLUFF
See Also:
Constant Field Values

ARMS

public static final int ARMS
See Also:
Constant Field Values

LEGS

public static final int LEGS
See Also:
Constant Field Values

SIZE

public static final int SIZE
Constructor Detail

Terrains

public Terrains()
Method Detail

getName

public static java.lang.String getName(int type)
Parameters:
type -
Returns:

getDisplayName

public static java.lang.String getDisplayName(int type,
                                              int level)
Parameters:
type -
level -
Returns:
a displayable name for this terrain (for tooltips)

getType

public static int getType(java.lang.String name)
This function converts the name of a terrain into the constant.

Parameters:
name - the name of the terain (from the names list.
Returns:
an integer coresponding to the terain, or 0 if no match (terrain none)

getTerrainFactory

public static ITerrainFactory getTerrainFactory()

getHash

protected static java.util.Hashtable<java.lang.String,java.lang.Integer> getHash()

createTerrain

public ITerrain createTerrain(int type,
                              int level)
Description copied from interface: ITerrainFactory
Create terrain of cpecified type and level

Specified by:
createTerrain in interface ITerrainFactory
Parameters:
type - terrain type
level - level
Returns:
new terrain

createTerrain

public ITerrain createTerrain(int type,
                              int level,
                              boolean exitsSpecified,
                              int exits)
Description copied from interface: ITerrainFactory
Create terrain of cpecified type, level , exitsSpecified flag and exits,

Specified by:
createTerrain in interface ITerrainFactory
Returns:
new terrain

createTerrain

public ITerrain createTerrain(java.lang.String terrain)
Description copied from interface: ITerrainFactory
Create Terrain using string containing terrain info TODO I think this shoul be removed. It's too much implementation specfic

Specified by:
createTerrain in interface ITerrainFactory
Returns:
new terrain

createTerrain

public ITerrain createTerrain(ITerrain other)
Description copied from interface: ITerrainFactory
Create terrain as copy of other

Specified by:
createTerrain in interface ITerrainFactory
Returns:
new terrain

getTerrainFactor

public static int getTerrainFactor(int type,
                                   int level)
Parameters:
level -
Returns:
the terrain factor for the given type and level - pg. 64, TacOps