public class BattleHex extends Hex
Modifier and Type | Field and Description |
---|---|
private static char[] |
allHexsides
The array of all the valid terrain type for a BattleHex Side.
|
private int |
elevation
Valid elevations are 0, 1, and 2.
|
private HazardHexside[] |
hexsideHazards
Hold the HazardHexside type of the six side of the BattleHex
(e.g.
|
static int |
IMPASSIBLE_COST
Movement costs
|
private static java.util.logging.Logger |
LOGGER |
private BattleHex[] |
neighbors
Links to the neighbors of the BattleHex.
|
private static int |
NORMAL_COST |
private static int |
SLOW_COST |
private static int |
SLOW_INCREMENT_COST |
private HazardTerrain |
terrain |
Constructor and Description |
---|
BattleHex(int xCoord,
int yCoord) |
Modifier and Type | Method and Description |
---|---|
private static char |
_intXCoordToXLabel(int x)
a char for an int: 0:'A'=0, 1:'B', ...
|
boolean |
blocksLineOfSight()
Whether this hex blocks rangestrike.
|
boolean |
canBeFlownOverBy(CreatureType creature)
Check if the Creature given in parameter can fly over
the BattleHex, or not.
|
private static java.lang.String |
createLabel(int xCoord,
int yCoord) |
int |
damageToCreature(CreatureType creature)
Return how much damage the Creature should take from this Hex.
|
int |
getElevation() |
int |
getEntryCost(CreatureType creature,
int cameFrom,
boolean cumul)
Return the number of movement points it costs to enter this hex.
|
HazardHexside |
getHexsideHazard(int i)
TODO use side enumeration types instead of integers
Return the HazardHexside (enumType) at the hex' side number i
|
java.lang.String |
getHexsideImageName(int i) |
static char[] |
getHexsides() |
BattleHex |
getNeighbor(int i) |
HazardHexside |
getOppositeHazard(int i)
Return the hazard type of opposite side of side i.
|
char |
getOppositeHexside(int i)
TODO get rid of this char based one
Return the character code of the hazard type
of opposite side of side i.
|
HazardTerrain |
getTerrain() |
java.awt.Color |
getTerrainColor() |
java.lang.String |
getTerrainName() |
boolean |
hasWall() |
boolean |
isCliff(int hexside) |
boolean |
isEntrance() |
boolean |
isNativeBonusTerrain() |
boolean |
isNonNativePenaltyTerrain() |
void |
setElevation(int elevation) |
void |
setHexsideHazard(int i,
HazardHexside hazard) |
void |
setNeighbor(int i,
BattleHex hex) |
void |
setTerrain(HazardTerrain terrain) |
int |
slowsCreature(CreatureType creature)
Return how much the hex slows the creature for the rest of the battle
|
private static final java.util.logging.Logger LOGGER
private int elevation
private static final char[] allHexsides
private final HazardHexside[] hexsideHazards
private final BattleHex[] neighbors
private HazardTerrain terrain
public static final int IMPASSIBLE_COST
private static final int SLOW_COST
private static final int NORMAL_COST
private static final int SLOW_INCREMENT_COST
private static java.lang.String createLabel(int xCoord, int yCoord)
private static final char _intXCoordToXLabel(int x)
public HazardTerrain getTerrain()
public void setTerrain(HazardTerrain terrain)
public java.lang.String getTerrainName()
getTerrainName
in class Hex
public java.awt.Color getTerrainColor()
public boolean isNativeBonusTerrain()
public boolean isNonNativePenaltyTerrain()
public void setHexsideHazard(int i, HazardHexside hazard)
public HazardHexside getHexsideHazard(int i)
i
- The side number, from 0 to 5public java.lang.String getHexsideImageName(int i)
public HazardHexside getOppositeHazard(int i)
public char getOppositeHexside(int i)
public int getElevation()
public void setElevation(int elevation)
public BattleHex getNeighbor(int i)
public void setNeighbor(int i, BattleHex hex)
public boolean isEntrance()
public boolean hasWall()
public boolean blocksLineOfSight()
public int getEntryCost(CreatureType creature, int cameFrom, boolean cumul)
creature
- The Creature that is trying to move into the BattleHex.cameFrom
- The HexSide through which the Creature try to enter.public boolean canBeFlownOverBy(CreatureType creature)
creature
- The Creature that want to fly over this BattleHexpublic int slowsCreature(CreatureType creature)
creature
- The Creature that may be slowed.public int damageToCreature(CreatureType creature)
creature
- The Creature that may suffer damage.public boolean isCliff(int hexside)
public static char[] getHexsides()