|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.game.Battle
public abstract class Battle
An ongoing battle.
Field Summary | |
---|---|
protected Legion |
attacker
|
protected Legion |
defender
|
protected Game |
game
|
private MasterHex |
location
|
private static java.util.logging.Logger |
LOGGER
|
Constructor Summary | |
---|---|
Battle(Game game,
Legion attacker,
Legion defender,
MasterHex location)
|
Method Summary | |
---|---|
int |
computeSkillPenaltyRangestrikeThrough(BattleHex hex1,
BattleHex hex2,
Creature c)
Compute the minimum Skill penalty that the creature will endure to rangestrike from hex1 to a creature in hex2 from the intervening hex. |
private int |
computeSkillPenaltyRangestrikeThroughDir(BattleHex hex1,
BattleHex hex2,
Creature c,
boolean left,
int previousCount)
|
Legion |
getAttackingLegion()
|
Legion |
getDefendingLegion()
|
static int |
getDirection(BattleHex hex1,
BattleHex hex2,
boolean left)
Return the hexside direction of the path from hex1 to hex2. |
Game |
getGame()
|
protected Legion |
getLegionByPlayer(Player player)
|
MasterHex |
getLocation()
|
static int |
getRange(BattleHex hex1,
BattleHex hex2,
boolean allowEntrance)
Return the range in hexes from hex1 to hex2. |
boolean |
isLOSBlocked(BattleHex hex1,
BattleHex hex2)
Check to see if the LOS from hex1 to hex2 is blocked. |
protected boolean |
isLOSBlockedDir(BattleHex initialHex,
BattleHex currentHex,
BattleHex finalHex,
boolean left,
int strikeElevation,
boolean strikerAtop,
boolean strikerAtopCliff,
boolean strikerAtopWall,
boolean midObstacle,
boolean midCliff,
boolean midChit,
int totalObstacles,
int totalWalls)
Check LOS, going to the left of hexspines if argument left is true, or to the right if it is false. |
private static boolean |
isObstacle(char hexside)
Deprecated. This is the realm of HazardEdge, not direct use of hexside |
protected abstract boolean |
isOccupied(BattleHex hex)
Whether the hex is occupied by a critter/creature/chit/... |
protected boolean |
isRangestrikePossible(Creature critter,
Creature target,
BattleHex currentHex,
BattleHex targetHex)
Return true if the rangestrike is possible. |
private static int |
minRangeToNeighbor(BattleHex hex1,
BattleHex hex2)
Return the minimum range from any neighbor of hex1 to hex2. |
static boolean |
toLeft(double xDist,
double yDist)
Caller must ensure that yDist != 0 TODO Temporarily public because n.s.c.client.Strike needs it |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger LOGGER
protected final Game game
protected final Legion attacker
protected final Legion defender
private final MasterHex location
Constructor Detail |
---|
public Battle(Game game, Legion attacker, Legion defender, MasterHex location)
Method Detail |
---|
public Game getGame()
public Legion getAttackingLegion()
public Legion getDefendingLegion()
protected abstract boolean isOccupied(BattleHex hex)
hex
- The hex whose occupancy is being checked
public static boolean toLeft(double xDist, double yDist)
public static int getDirection(BattleHex hex1, BattleHex hex2, boolean left)
@Deprecated private static boolean isObstacle(char hexside)
public static int getRange(BattleHex hex1, BattleHex hex2, boolean allowEntrance)
private static int minRangeToNeighbor(BattleHex hex1, BattleHex hex2)
public boolean isLOSBlocked(BattleHex hex1, BattleHex hex2)
protected boolean isLOSBlockedDir(BattleHex initialHex, BattleHex currentHex, BattleHex finalHex, boolean left, int strikeElevation, boolean strikerAtop, boolean strikerAtopCliff, boolean strikerAtopWall, boolean midObstacle, boolean midCliff, boolean midChit, int totalObstacles, int totalWalls)
protected boolean isRangestrikePossible(Creature critter, Creature target, BattleHex currentHex, BattleHex targetHex)
private int computeSkillPenaltyRangestrikeThroughDir(BattleHex hex1, BattleHex hex2, Creature c, boolean left, int previousCount)
public int computeSkillPenaltyRangestrikeThrough(BattleHex hex1, BattleHex hex2, Creature c)
hex1
- The hex in which the rangestriker sithex2
- The hex in which the rangestruck sitc
- The rangestriker
protected Legion getLegionByPlayer(Player player)
public MasterHex getLocation()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |