|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.variant.Hex
net.sf.colossus.variant.BattleHex
public class BattleHex
Class BattleHex holds game state for battle hex.
Field Summary | |
---|---|
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 Summary | |
---|---|
BattleHex(int xCoord,
int yCoord)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class net.sf.colossus.variant.Hex |
---|
equals, getDescription, getLabel, getXCoord, getYCoord, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public BattleHex(int xCoord, int yCoord)
Method Detail |
---|
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 5
public 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 BattleHex
public int damageToCreature(CreatureType creature)
creature
- The Creature that may suffer damage.
public boolean isCliff(int hexside)
public static char[] getHexsides()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |