|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.Hex
public class Hex
Hex represents a single hex on the board.
| Constructor Summary | |
|---|---|
Hex()
Constructs clear, plain hex at level 0. |
|
Hex(int elevation)
Constructs clean, plain hex at specified elevation. |
|
Hex(int elevation,
ITerrain[] terrains,
java.lang.String theme)
|
|
Hex(int elevation,
ITerrain[] terrains,
java.lang.String theme,
Coords c)
Constructs hex with all parameters. |
|
Hex(int elevation,
java.lang.String terrain,
java.lang.String theme)
|
|
Hex(int elevation,
java.lang.String terrain,
java.lang.String theme,
Coords c)
Contructs hex with string terrain info |
|
| Method Summary | |
|---|---|
void |
addTerrain(ITerrain terrain)
Adds the specified terrain |
int |
ceiling()
|
void |
clearExits()
Clears the "exits" flag for all terrains in the hex where it is not manually specified. |
boolean |
containsTerrain(int type)
|
boolean |
containsTerrain(int type,
int level)
|
boolean |
containsTerrainExit(int terrType,
int direction)
Determine if this Hex contains the indicated terrain that
exits in the specified direction. |
int |
depth()
|
int |
displayableTerrainsPresent()
|
IHex |
duplicate()
|
int |
floor()
|
int |
getBogDownModifier(EntityMovementMode moveMode,
boolean largeVee)
get any modifiers to a bog-down roll in this hex. |
Coords |
getCoords()
|
int |
getElevation()
|
int |
getFireTurn()
|
int |
getIgnitionModifier()
|
ITerrain |
getTerrain(int type)
|
java.lang.String |
getTheme()
The theme is intended as a tag for the tileset file to indicate a special graphic for the hex. |
int |
getUnstuckModifier(int elev)
get any modifiers to a an unstuck roll in this hex. |
boolean |
hasPavement()
|
void |
incrementFireTurn()
|
boolean |
isClear()
|
boolean |
isIgnitable()
Is this hex ignitable? |
int |
movementCost(EntityMovementMode moveMode)
(Only if statically determinable) |
void |
removeAllTerrains()
Removes all Terreains from the hex. |
void |
removeTerrain(int type)
Removes the specified terrain |
void |
resetFireTurn()
|
void |
setElevation(int elevation)
set the elevation |
void |
setExits(IHex other,
int direction)
Sets the "exits" flag appropriately, assuming the specified hex lies in the specified direction on the board. |
void |
setExits(IHex other,
int direction,
boolean roadsAutoExit)
Sets the "exits" flag appropriately, assuming the specified hex lies in the specified direction on the board. |
void |
setTheme(java.lang.String theme)
Set the hex theme. |
int |
surface()
|
int |
terrainLevel(int type)
|
int |
terrainPilotingModifier(EntityMovementMode moveMode)
|
int |
terrainsPresent()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Hex()
public Hex(int elevation)
public Hex(int elevation,
ITerrain[] terrains,
java.lang.String theme)
public Hex(int elevation,
ITerrain[] terrains,
java.lang.String theme,
Coords c)
public Hex(int elevation,
java.lang.String terrain,
java.lang.String theme)
public Hex(int elevation,
java.lang.String terrain,
java.lang.String theme,
Coords c)
| Method Detail |
|---|
public int getElevation()
getElevation in interface IHexpublic void setElevation(int elevation)
IHex
setElevation in interface IHexpublic java.lang.String getTheme()
IHex
getTheme in interface IHexpublic void setTheme(java.lang.String theme)
IHex
setTheme in interface IHextheme - theme namegetThemepublic void clearExits()
IHex
clearExits in interface IHex
public void setExits(IHex other,
int direction)
IHexTerrain.ROADs will exit onto
Terrain.PAVEMENT hexes automatically.
setExits in interface IHexother - neighbour hexdirection - - the int direction of the exit. This
value should be between 0 and 5 (inclusive).IHex.setExits(IHex, int, boolean)
public void setExits(IHex other,
int direction,
boolean roadsAutoExit)
IHexroadsAutoExit is
true, any Terrain.ROAD will exit onto
Terrain.PAVEMENT hexes automatically.
setExits in interface IHexother - neighbour hexdirection - - the int direction of the exit. This
value should be between 0 and 5 (inclusive).IHex.setExits(IHex, int)
public boolean containsTerrainExit(int terrType,
int direction)
IHexHex contains the indicated terrain that
exits in the specified direction.
containsTerrainExit in interface IHexterrType - - the int type of the terrain.direction - - the int direction of the exit. This
value should be between 0 and 5 (inclusive).
true if this Hex contains the
indicated terrain that exits in the specified direction.
false if bad input is supplied, if no such terrain
exists, or if it doesn't exit in that direction.IHex.setExits(IHex, int, boolean)public int ceiling()
ceiling in interface IHexpublic int surface()
surface in interface IHexpublic int floor()
floor in interface IHexpublic int depth()
depth in interface IHexpublic boolean containsTerrain(int type)
containsTerrain in interface IHextype - terrain to check
true if the specified terrain is represented in
the hex at any level.IHex.containsTerrain(int, int)
public boolean containsTerrain(int type,
int level)
containsTerrain in interface IHextype - terrain type to checklevel - level to check the presence of the given terrain at
true if the specified terrain is represented in
the hex at given level.IHex.containsTerrain(int)public boolean hasPavement()
hasPavement in interface IHexpublic int terrainLevel(int type)
terrainLevel in interface IHexpublic ITerrain getTerrain(int type)
getTerrain in interface IHexnull if the
terrain is not present in the hexpublic void addTerrain(ITerrain terrain)
IHex
addTerrain in interface IHexterrain - terrain to addpublic void removeTerrain(int type)
IHex
removeTerrain in interface IHexpublic void removeAllTerrains()
IHex
removeAllTerrains in interface IHexpublic int displayableTerrainsPresent()
displayableTerrainsPresent in interface IHexpublic int terrainsPresent()
terrainsPresent in interface IHexpublic IHex duplicate()
duplicate in interface IHexpublic int terrainPilotingModifier(EntityMovementMode moveMode)
terrainPilotingModifier in interface IHexpublic int movementCost(EntityMovementMode moveMode)
IHex
movementCost in interface IHexpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getIgnitionModifier()
getIgnitionModifier in interface IHexpublic boolean isIgnitable()
isIgnitable in interface IHextrue if this hex is ignitablepublic boolean isClear()
isClear in interface IHexpublic int getFireTurn()
getFireTurn in interface IHexpublic void incrementFireTurn()
incrementFireTurn in interface IHexpublic void resetFireTurn()
resetFireTurn in interface IHex
public int getBogDownModifier(EntityMovementMode moveMode,
boolean largeVee)
getBogDownModifier in interface IHexpublic int getUnstuckModifier(int elev)
getUnstuckModifier in interface IHexpublic Coords getCoords()
getCoords in interface IHex
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||