megamek.common
Interface ITerrain

All Known Implementing Classes:
Terrain

public interface ITerrain

Represents a single type of terrain or condition in a hex. The type of a terrain is immutable, once created, but the level and exits are changable. Each type of terrain should only be represented once in a hex.

Author:
Ben

Field Summary
static int LEVEL_NONE
           
static int WILDCARD
           
 
Method Summary
 boolean exitsTo(ITerrain other)
           
 void flipExits(boolean horiz, boolean vert)
          Flips the exits around the vertical axis (North-for-South) and/or the horizontal axis (East-for-West).
 int getBogDownModifier(EntityMovementMode moveMode, boolean largeVee)
           
 int getExits()
           
 int getLevel()
           
 int getTerrainFactor()
           
 int getType()
           
 int getUnstuckModifier(int elev)
           
 boolean hasExitsSpecified()
           
 int ignitionModifier()
          the fire ignition modifier for this terrain
 int movementCost(EntityMovementMode moveMode)
           
 int pilotingModifier(EntityMovementMode moveMode)
           
 void setExit(int direction, boolean connection)
          Sets the exit in specified direction
 void setExits(int exits)
          Sets the exits
 void setTerrainFactor(int tf)
          set terrain factor
 

Field Detail

LEVEL_NONE

static final int LEVEL_NONE
See Also:
Constant Field Values

WILDCARD

static final int WILDCARD
See Also:
Constant Field Values
Method Detail

getType

int getType()
Returns:
terrain type

getLevel

int getLevel()
Returns:
terrain level

getTerrainFactor

int getTerrainFactor()
Returns:
terrain factor

setTerrainFactor

void setTerrainFactor(int tf)
set terrain factor


getExits

int getExits()
Returns:
exits

hasExitsSpecified

boolean hasExitsSpecified()
Returns:
true if exits are specified

setExits

void setExits(int exits)
Sets the exits

Parameters:
exits -

setExit

void setExit(int direction,
             boolean connection)
Sets the exit in specified direction

Parameters:
direction - - the direction to add/remove the exit
connection - - true to add, false to remove

flipExits

void flipExits(boolean horiz,
               boolean vert)
Flips the exits around the vertical axis (North-for-South) and/or the horizontal axis (East-for-West).

Parameters:
horiz - - a boolean value that, if true, indicates that the exits are being flipped North-for-South.
vert - - a boolean value that, if true, indicates that the exits are being flipped East-for-West.

exitsTo

boolean exitsTo(ITerrain other)
Returns:
true if the terrain in this hex exits to the terrain in the other hex.

pilotingModifier

int pilotingModifier(EntityMovementMode moveMode)
Returns:
the modifier to PSRs made in this terrain

movementCost

int movementCost(EntityMovementMode moveMode)
Returns:
the additional movement cost for this terrain

ignitionModifier

int ignitionModifier()
the fire ignition modifier for this terrain


getBogDownModifier

int getBogDownModifier(EntityMovementMode moveMode,
                       boolean largeVee)

getUnstuckModifier

int getUnstuckModifier(int elev)