public class BattleClientSide extends Battle
Modifier and Type | Field and Description |
---|---|
private Player |
battleActivePlayer |
private BattlePhase |
battlePhase |
private java.util.List<BattleUnit> |
battleUnits |
private static java.util.logging.Logger |
LOGGER |
attacker, battleTurnNumber, defender, game
Constructor and Description |
---|
BattleClientSide(Game game,
Legion attacker,
Legion defender,
MasterHex location) |
Modifier and Type | Method and Description |
---|---|
boolean |
anyOffboardCreatures() |
boolean |
canStrike(BattleCritter striker,
BattleCritter target)
Tell whether a given creature can strike (rangestrike included)
the given potential target
TODO duplicated in CreatureServerSide
|
void |
cleanupBattle() |
BattleUnit |
createBattleUnit(java.lang.String imageName,
boolean isDefender,
int tag,
BattleHex hex,
CreatureType type,
Legion legion) |
(package private) java.util.Set<BattleHex> |
findCrittersWithTargets(Client client)
Return the set of hexes with critters that have
valid strike targets.
|
java.util.Set<BattleHex> |
findTargets(BattleCritter battleUnit,
boolean rangestrike)
Return a set of hexes containing targets that the critter may strike
TODO duplicated in BattleServerSide
|
java.util.Set<BattleHex> |
findTargets(int tag) |
java.util.List<BattleUnit> |
getActiveBattleUnits() |
java.util.List<BattleCritter> |
getAllCritters()
Get all BattleCritters / BattleUnits
Abstract because currently implementation is different, but needed
on both side, e.g.
|
Legion |
getBattleActiveLegion() |
Player |
getBattleActivePlayer() |
BattlePhase |
getBattlePhase() |
java.lang.String |
getBattlePhaseName() |
BattleUnit |
getBattleUnit(BattleHex hex) |
(package private) BattleUnit |
getBattleUnit(int tag)
Get the BattleUnit with this tag.
|
BattleUnit |
getBattleUnitCS(BattleHex hex) |
java.util.List<BattleUnit> |
getBattleUnits() |
java.util.List<BattleUnit> |
getBattleUnits(BattleHex hex) |
GameClientSide |
getGameClientSide() |
java.util.List<BattleUnit> |
getInactiveBattleUnits() |
void |
init(int battleTurnNumber,
Player battleActivePlayer,
BattlePhase battlePhase) |
boolean |
isBattlePhase(BattlePhase phase) |
boolean |
isCritterOffboard(BattleCritter critter) |
boolean |
isInContact(BattleCritter striker,
boolean countDead)
Return true if there are any enemies adjacent to this battleChit.
|
private boolean |
isRangestrikePossible(BattleCritter striker,
BattleCritter target)
Deprecated.
Should use an extension of Battle instead of Strike, with
extension of Creature instead of BattleCritter and extra BattleHex
|
boolean |
isTitanOffboard(Player player) |
void |
markOffboardCreaturesDead() |
int |
minRangeToEnemy(BattleCritter critter)
Deprecated.
Should use an extension of Battle instead of Strike
// END OLD COMMENT
Now this is moved from Strike to BattleClientSide.
IMHO this is not a total duplicate of a method in Battle: Battle
does not have a minRangeToEnemy, just minRange between concrete hexes,
which IS actually called here.
TODO can they be unified? Or move to e.g. some class in ai.helper package?
|
void |
removeDeadBattleChits() |
void |
resetAllBattleMoves() |
void |
setBattleActivePlayer(Player battleActivePlayer) |
void |
setBattlePhase(BattlePhase battlePhase) |
void |
setupBattleFight(BattlePhase battlePhase,
Player battleActivePlayer) |
void |
setupPhase(BattlePhase phase,
Player battleActivePlayer,
int battleTurnNumber) |
computeSkillPenaltyRangestrikeThrough, countBrambleHexes, getAttackingLegion, getBattleTurnNumber, getCritter, getDefendingLegion, getDirection, getGame, getLegionByPlayer, getLocation, getRange, isLOSBlocked, isLOSBlockedDir, isObstacle, isOccupied, isRangestrikePossible, setBattleTurnNumber, toLeft
private static final java.util.logging.Logger LOGGER
private BattlePhase battlePhase
private Player battleActivePlayer
private final java.util.List<BattleUnit> battleUnits
public void init(int battleTurnNumber, Player battleActivePlayer, BattlePhase battlePhase)
public GameClientSide getGameClientSide()
public Player getBattleActivePlayer()
public void cleanupBattle()
public Legion getBattleActiveLegion()
getBattleActiveLegion
in class Battle
public BattlePhase getBattlePhase()
public void setBattlePhase(BattlePhase battlePhase)
public boolean isBattlePhase(BattlePhase phase)
public void setupPhase(BattlePhase phase, Player battleActivePlayer, int battleTurnNumber)
public java.lang.String getBattlePhaseName()
public void setBattleActivePlayer(Player battleActivePlayer)
public void setupBattleFight(BattlePhase battlePhase, Player battleActivePlayer)
public BattleUnit createBattleUnit(java.lang.String imageName, boolean isDefender, int tag, BattleHex hex, CreatureType type, Legion legion)
public boolean anyOffboardCreatures()
public boolean isCritterOffboard(BattleCritter critter)
public boolean isTitanOffboard(Player player)
public java.util.List<BattleUnit> getActiveBattleUnits()
public java.util.List<BattleUnit> getInactiveBattleUnits()
public java.util.List<BattleCritter> getAllCritters()
Battle
getAllCritters
in class Battle
public java.util.List<BattleUnit> getBattleUnits()
public java.util.List<BattleUnit> getBattleUnits(BattleHex hex)
public BattleUnit getBattleUnitCS(BattleHex hex)
public BattleUnit getBattleUnit(BattleHex hex)
BattleUnit getBattleUnit(int tag)
public void resetAllBattleMoves()
public void markOffboardCreaturesDead()
public void removeDeadBattleChits()
java.util.Set<BattleHex> findCrittersWithTargets(Client client)
client
- The client.public boolean canStrike(BattleCritter striker, BattleCritter target)
striker
- The creature strikingtarget
- The potential targetpublic java.util.Set<BattleHex> findTargets(int tag)
public java.util.Set<BattleHex> findTargets(BattleCritter battleUnit, boolean rangestrike)
battleUnit
- the striking creaturerangestrike
- Whether to include rangestrike targets@Deprecated private boolean isRangestrikePossible(BattleCritter striker, BattleCritter target)
@Deprecated public int minRangeToEnemy(BattleCritter critter)
public boolean isInContact(BattleCritter striker, boolean countDead)
isInContact
in class Battle