Package megamek.common.units
Class Terrains
java.lang.Object
megamek.common.units.Terrains
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTerrains in this set are hidden in the Editor, not saved to board files and handled internally.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intMarks a bridge hex whose section was rebuilt in-game by Bridge-Building Engineers (the unofficial bridge-repair option), so the board view can badge it as a field repair.static final intstatic final intBaseFLUFFterrain level for the cosmetic "cleared rubble path" overlay left after a bulldozer clears a rubble hex (TacOps).static final intstatic final intstatic final intstatic final intDeprecated, for removal: This API element is subject to removal in a future version.static final int[]Keeps track of the different type of terrains that can have exits.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intThe SCREEN terrain type stands for chaff hexes generated by screen launchers in space.static final intstatic final intstatic final intThe SMOKE terrain type includes laser-inhibiting smoke and chaff from chaff pods (TO:AUE p111).static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanexitableTerrain(int terrType) Checks to see if the given terrain type can have exits.static StringgetDisplayName(int type, int level) Returns a name to be displayed in tooltips.static StringgetEditorName(int type) static StringgetEditorTooltip(int type) getHash()static StringgetName(int type) static intgetTerrainElevation(int terrainType, int terrainLevel, boolean inAtmosphere) Returns the number of elevations or altitudes above the hex level a given terrainType rises.static intgetTerrainFactor(int type, int level) static intThis function converts the name of a terrain into the constant.static booleanisBaseTerrain(int terrainType) Returns true if the terrain is a base terrain type, excluding "Clear"static intlandingModifier(int terrainType, int terrainLevel) Modifier to control roll when the terrain is in the landing path.
-
Field Details
-
WOODS
public static final int WOODS- See Also:
-
WATER
public static final int WATER- See Also:
-
ROUGH
public static final int ROUGH- See Also:
-
RUBBLE
public static final int RUBBLE- See Also:
-
CLEARED_RUBBLE_FLUFF_BASE
public static final int CLEARED_RUBBLE_FLUFF_BASEBaseFLUFFterrain level for the cosmetic "cleared rubble path" overlay left after a bulldozer clears a rubble hex (TacOps). The hex itself becomes clear terrain (rubble removed); a fluff terrain atCLEARED_RUBBLE_FLUFF_BASE + structureType(1 light .. 5 wall) is added purely so the tileset can draw the rubble "_path" tiles showing the hex was once rubble. Fluff has no gameplay effect (seeHex.isClearHex).- See Also:
-
JUNGLE
public static final int JUNGLE- See Also:
-
SAND
public static final int SAND- See Also:
-
TUNDRA
public static final int TUNDRA- See Also:
-
MAGMA
public static final int MAGMA- See Also:
-
FIELDS
public static final int FIELDS- See Also:
-
INDUSTRIAL
public static final int INDUSTRIAL- See Also:
-
SPACE
public static final int SPACE- See Also:
-
PAVEMENT
public static final int PAVEMENT- See Also:
-
ROAD
public static final int ROAD- See Also:
-
ROAD_LVL_DIRT
public static final int ROAD_LVL_DIRT- See Also:
-
ROAD_LVL_GRAVEL
public static final int ROAD_LVL_GRAVEL- See Also:
-
SWAMP
public static final int SWAMP- See Also:
-
MUD
public static final int MUD- See Also:
-
RAPIDS
public static final int RAPIDS- See Also:
-
ICE
public static final int ICE- See Also:
-
SNOW
public static final int SNOW- See Also:
-
FIRE
public static final int FIRE- See Also:
-
SMOKE
public static final int SMOKEThe SMOKE terrain type includes laser-inhibiting smoke and chaff from chaff pods (TO:AUE p111).- See Also:
-
GEYSER
public static final int GEYSER- See Also:
-
FIRE_LVL_NORMAL
public static final int FIRE_LVL_NORMAL- See Also:
-
FIRE_LVL_INFERNO
public static final int FIRE_LVL_INFERNO- See Also:
-
FIRE_LVL_INFERNO_BOMB
public static final int FIRE_LVL_INFERNO_BOMB- See Also:
-
FIRE_LVL_INFERNO_IV
public static final int FIRE_LVL_INFERNO_IV- See Also:
-
GEYSER_LVL_DORMANT
public static final int GEYSER_LVL_DORMANT- See Also:
-
GEYSER_LVL_ACTIVE
public static final int GEYSER_LVL_ACTIVE- See Also:
-
GEYSER_LVL_MAGMA_VENT
public static final int GEYSER_LVL_MAGMA_VENT- See Also:
-
BUILDING
public static final int BUILDING- See Also:
-
BLDG_CF
public static final int BLDG_CF- See Also:
-
BLDG_ELEV
public static final int BLDG_ELEV- See Also:
-
BLDG_BASEMENT_TYPE
public static final int BLDG_BASEMENT_TYPE- See Also:
-
BLDG_CLASS
public static final int BLDG_CLASS- See Also:
-
BLDG_ARMOR
public static final int BLDG_ARMOR- See Also:
-
BRIDGE
public static final int BRIDGE- See Also:
-
BRIDGE_CF
public static final int BRIDGE_CF- See Also:
-
BRIDGE_ELEV
public static final int BRIDGE_ELEV- See Also:
-
FUEL_TANK
public static final int FUEL_TANK- See Also:
-
FUEL_TANK_CF
public static final int FUEL_TANK_CF- See Also:
-
FUEL_TANK_ELEV
public static final int FUEL_TANK_ELEV- See Also:
-
FUEL_TANK_MAGN
public static final int FUEL_TANK_MAGN- See Also:
-
IMPASSABLE
public static final int IMPASSABLE- See Also:
-
SOLARIS_ELEVATOR
public static final int SOLARIS_ELEVATOR- See Also:
-
ELEVATOR
Deprecated, for removal: This API element is subject to removal in a future version.useSOLARIS_ELEVATOR; renamed to distinguish it fromINDUSTRIAL_ELEVATOR.- See Also:
-
FORTIFIED
public static final int FORTIFIED- See Also:
-
SCREEN
public static final int SCREENThe SCREEN terrain type stands for chaff hexes generated by screen launchers in space.- See Also:
-
FLUFF
public static final int FLUFF- See Also:
-
ARMS
public static final int ARMS- See Also:
-
LEGS
public static final int LEGS- See Also:
-
METAL_CONTENT
public static final int METAL_CONTENT- See Also:
-
BLDG_BASE_COLLAPSED
public static final int BLDG_BASE_COLLAPSED- See Also:
-
BLDG_FLUFF
public static final int BLDG_FLUFF- See Also:
-
ROAD_FLUFF
public static final int ROAD_FLUFF- See Also:
-
GROUND_FLUFF
public static final int GROUND_FLUFF- See Also:
-
WATER_FLUFF
public static final int WATER_FLUFF- See Also:
-
CLIFF_TOP
public static final int CLIFF_TOP- See Also:
-
CLIFF_BOTTOM
public static final int CLIFF_BOTTOM- See Also:
-
INCLINE_TOP
public static final int INCLINE_TOP- See Also:
-
INCLINE_BOTTOM
public static final int INCLINE_BOTTOM- See Also:
-
INCLINE_HIGH_TOP
public static final int INCLINE_HIGH_TOP- See Also:
-
INCLINE_HIGH_BOTTOM
public static final int INCLINE_HIGH_BOTTOM- See Also:
-
FOLIAGE_ELEV
public static final int FOLIAGE_ELEV- See Also:
-
BLACK_ICE
public static final int BLACK_ICE- See Also:
-
SKY
public static final int SKY- See Also:
-
DEPLOYMENT_ZONE
public static final int DEPLOYMENT_ZONE- See Also:
-
HAZARDOUS_LIQUID
public static final int HAZARDOUS_LIQUID- See Also:
-
ULTRA_SUBLEVEL
public static final int ULTRA_SUBLEVEL- See Also:
-
INDUSTRIAL_ELEVATOR
public static final int INDUSTRIAL_ELEVATOR- See Also:
-
BRIDGE_REPAIRED
public static final int BRIDGE_REPAIREDMarks a bridge hex whose section was rebuilt in-game by Bridge-Building Engineers (the unofficial bridge-repair option), so the board view can badge it as a field repair. A data-only marker carried alongside the BRIDGE terrain; it serializes with the hex (surviving save games) and is removed when the bridge is destroyed.- See Also:
-
exitableTerrains
public static final int[] exitableTerrainsKeeps track of the different type of terrains that can have exits. -
AUTOMATIC
Terrains in this set are hidden in the Editor, not saved to board files and handled internally. -
SIZE
public static final int SIZE -
HAZARDS
-
HAZARDS_WITH_BLACK_ICE
-
INVALID_TRIPWIRE_TERRAIN
-
INVALID_PITFALL_TERRAIN
-
-
Constructor Details
-
Terrains
public Terrains()
-
-
Method Details
-
exitableTerrain
public static boolean exitableTerrain(int terrType) Checks to see if the given terrain type can have exits.- Parameters:
terrType- The terrain type to test- Returns:
- True if the input terrain type can have exits, else false.
-
getName
- Parameters:
type- the type of terrain to get the name for- Returns:
- the name of the specified type of terrain
-
getEditorName
- Parameters:
type- the type of terrain to get a localized name for- Returns:
- the localised name of the type of terrain
-
getEditorTooltip
- Parameters:
type- the type of terrain to get a localized name for- Returns:
- the localised tool tip for the type of terrain
-
getDisplayName
Returns a name to be displayed in tooltips. Intentionally returns null for terrains that should be treated separately such as buildings and for terrains that should not be listed such as cliff-tops.- Parameters:
type- the type of terrain to get the name forlevel- the level of the terrain to get the specific name- Returns:
- a displayable name for this terrain (for tooltips)
-
getType
This function converts the name of a terrain into the constant.- Parameters:
name- the name of the terrain (from the names list above)- Returns:
- an integer corresponding to the terrain, or 0 if no match (terrain none)
-
getHash
-
getTerrainFactor
public static int getTerrainFactor(int type, int level) - Parameters:
type- the type of terrain specifiedlevel- the level of the specified terrain- Returns:
- the terrain factor for the given type and level - pg. 64, TacOps
-
getTerrainElevation
public static int getTerrainElevation(int terrainType, int terrainLevel, boolean inAtmosphere) Returns the number of elevations or altitudes above the hex level a given terrainType rises. Has to be explicit about the *_ELEV values, because _everything else_ that comes through here is a "level", a ranking of "denseness", not an elevation _or_ altitude.- Parameters:
terrainType- this specifies the type of terrain to get the information forinAtmosphere- Flag that determines whether elevations or altitudes should be returned.- Returns:
- The number of altitudes or elevations the given terrain type rises above the hex level.
-
landingModifier
public static int landingModifier(int terrainType, int terrainLevel) Modifier to control roll when the terrain is in the landing path.- Parameters:
terrainType- Type of terrainterrainLevel- The level of the terrain- Returns:
- The control roll modifier
-
isBaseTerrain
public static boolean isBaseTerrain(int terrainType) Returns true if the terrain is a base terrain type, excluding "Clear"
-
SOLARIS_ELEVATOR; renamed to distinguish it fromINDUSTRIAL_ELEVATOR.