public abstract class Battle
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Legion |
attacker |
protected int |
battleTurnNumber |
protected Legion |
defender |
protected Game |
game |
private MasterHex |
location |
private static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
Battle(Game game,
Legion attacker,
Legion defender,
MasterHex location) |
Modifier and Type | Method and Description |
---|---|
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) |
int |
countBrambleHexes(BattleHex hex1,
BattleHex hex2)
Deprecated.
another function with explicit reference to Bramble
that should be fixed.
|
private int |
countBrambleHexesDir(BattleHex hex1,
BattleHex hex2,
boolean left,
int previousCount)
Deprecated.
another function with explicit reference to Bramble
that should be fixed.
|
protected abstract java.util.List<BattleCritter> |
getAllCritters()
Get all BattleCritters / BattleUnits
Abstract because currently implementation is different, but needed
on both side, e.g.
|
Legion |
getAttackingLegion() |
abstract Legion |
getBattleActiveLegion() |
int |
getBattleTurnNumber() |
BattleCritter |
getCritter(BattleHex hex) |
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.
|
abstract boolean |
isInContact(BattleCritter striker,
boolean countDead) |
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.
|
protected static boolean |
isObstacle(char hexside)
Deprecated.
This is the realm of HazardEdge, not direct use of hexside
|
boolean |
isOccupied(BattleHex hex) |
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.
|
void |
setBattleTurnNumber(int battleTurnNumber) |
static boolean |
toLeft(double xDist,
double yDist)
Caller must ensure that yDist != 0
TODO Temporarily public because n.s.c.client.Strike needs it
|
private static final java.util.logging.Logger LOGGER
protected final Game game
protected final Legion attacker
protected final Legion defender
private final MasterHex location
protected int battleTurnNumber
public Game getGame()
public Legion getAttackingLegion()
public Legion getDefendingLegion()
public static boolean toLeft(double xDist, double yDist)
public static int getDirection(BattleHex hex1, BattleHex hex2, boolean left)
@Deprecated private int countBrambleHexesDir(BattleHex hex1, BattleHex hex2, boolean left, int previousCount)
@Deprecated public int countBrambleHexes(BattleHex hex1, BattleHex hex2)
@Deprecated protected 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 rangestrikerpublic MasterHex getLocation()
public void setBattleTurnNumber(int battleTurnNumber)
public int getBattleTurnNumber()
public BattleCritter getCritter(BattleHex hex)
public boolean isOccupied(BattleHex hex)
public abstract Legion getBattleActiveLegion()
protected abstract java.util.List<BattleCritter> getAllCritters()
public abstract boolean isInContact(BattleCritter striker, boolean countDead)