robocraft.common
Class TerrainType

java.lang.Object
  extended byrobocraft.common.CommonEnum
      extended byrobocraft.common.TerrainType

public class TerrainType
extends robocraft.common.CommonEnum

TerrainType represents the type of terrain assigned to a given map square.

The only instances of this class are those found in the static fields described below. This means that instances can always be meaningfully compared using ==.

See Also:
AbstractRobotPlayer.getTerrainType(robocraft.common.MapLocation)

Field Summary
static TerrainType INDOOR_LAND
          Represents the terrain type of an Indoor Land square, which permits all robots and objects.
static TerrainType OFF_MAP
          Represents the terrain type of squares which are outside the bounds of the map.
static TerrainType OUTDOOR_LAND
          Represents the terrain type of an Outdoor Land square, which permits all robots and objects.
static TerrainType WALL
          Represents the terrain type of a Wall square, which does not permit ground robots or energon cubes.
static TerrainType WATER
          Represents the terrain type of a Water square, which does not permit ground robots or energon cubes.
 
Method Summary
 boolean isAirTraversable()
          Determines whether this terrain permits air objects.
 boolean isGroundTraversable()
          Determines whether this terrain permits ground objects.
 java.lang.String toString()
          Returns the name of the terrain type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WATER

public static final TerrainType WATER
Represents the terrain type of a Water square, which does not permit ground robots or energon cubes. Water is functionally equivalent to Wall.


OUTDOOR_LAND

public static final TerrainType OUTDOOR_LAND
Represents the terrain type of an Outdoor Land square, which permits all robots and objects.


INDOOR_LAND

public static final TerrainType INDOOR_LAND
Represents the terrain type of an Indoor Land square, which permits all robots and objects.


WALL

public static final TerrainType WALL
Represents the terrain type of a Wall square, which does not permit ground robots or energon cubes.


OFF_MAP

public static final TerrainType OFF_MAP
Represents the terrain type of squares which are outside the bounds of the map. Off Map squares may not contain any kind of GameObject.

Method Detail

toString

public java.lang.String toString()
Returns the name of the terrain type.

Returns:
a String such as "Indoor-Land" or "Off-Map"

isGroundTraversable

public boolean isGroundTraversable()
Determines whether this terrain permits ground objects. Ground-traversable terrains permit energon cubes and ground robots, and may be passed through by diagonally-moving robots.


isAirTraversable

public boolean isAirTraversable()
Determines whether this terrain permits air objects. Air-traversable terrains permit flying robots. All terrains are air-traversable except for Off Map.