robocraft.common
Class TerrainType

java.lang.Object
  extended byrobocraft.common.CommonEnum
      extended byrobocraft.common.TerrainType
All Implemented Interfaces:
java.io.Serializable

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), Serialized Form

Field Summary
static TerrainType LAND
          Represents the terrain type of an Outdoor 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 WATER
          Represents the terrain type of a Water square, which does not permit ground objects.
 
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 objects.


LAND

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


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 ground objects, 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.