public final class LegionServerSide extends Legion implements java.lang.Comparable<LegionServerSide>
Legion.AcquirableDecision
Modifier and Type | Field and Description |
---|---|
private int |
battleTally
TODO this should be a
Creature or CreatureType |
private GameServerSide |
game |
private static java.util.logging.Logger |
LOGGER |
private Legion |
parent |
private MasterHex |
startingHex
The label of the starting hex of the last move.
|
angelsToAcquire, decisions, ORDER_TITAN_THEN_POINTS, ORDER_TITAN_THEN_POINTS_THEN_MARKER
Constructor and Description |
---|
LegionServerSide(java.lang.String markerId,
Legion parent,
MasterHex currentHex,
MasterHex startingHex,
Player player,
GameServerSide game,
CreatureType... creatureTypes)
Creates a new Legion instance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addAngel(CreatureType angelType) |
(package private) void |
addBattleTallyToPoints() |
void |
addCreature(CreatureType type) |
(package private) boolean |
addCreature(CreatureType creature,
boolean takeFromStack)
Add a creature to this legion.
|
(package private) void |
addCritter(CreatureServerSide critter) |
(package private) void |
addToBattleTally(int points) |
void |
askAcquirablesDecisions()
For each acquirable decision, ask the client to choose one
of the possible acquirables.
|
(package private) boolean |
canRecruit()
hasMoved() is a separate check, so that this function can be used in
battle as well as during the muster phase.
|
(package private) boolean |
canSummonAngel()
Return true if this legion can summon.
|
(package private) void |
clearBattleInfo() |
(package private) void |
clearBattleTally() |
(package private) void |
commitMove()
Called at end of player turn.
|
int |
compareTo(LegionServerSide other)
Legions are sorted in descending order of total point value,
with the titan legion always coming first.
|
(package private) void |
editRemoveCreature(CreatureType creature) |
(package private) int |
getBattleTally() |
java.util.List<CreatureServerSide> |
getCreatures()
TODO should be an unmodifiable List, but can't at the moment since both
derived classes and users might still expect to change it
TODO should be List
|
(package private) Creature |
getCritter(CreatureType creatureType)
Gets the first critter in this legion with the same creature
type as the passed creature.
|
(package private) CreatureServerSide |
getCritter(int i)
TODO avoid index-based access
|
(package private) CreatureServerSide |
getCritterByTag(int tag)
Return the first critter with a matching tag.
|
java.lang.String |
getLongMarkerName() |
static java.lang.String |
getLongMarkerName(java.lang.String markerId) |
java.lang.String |
getMarkerName() |
static java.lang.String |
getMarkerName(java.lang.String markerId) |
Legion |
getParent() |
PlayerServerSide |
getPlayer()
Retrieves the player this legion belongs to.
|
int |
getPointValue()
TODO unify between the two derived classes if possible -- the handling of Titans
is quite different, although it should have the same result
|
(package private) MasterHex |
getStartingHex() |
(package private) boolean |
hasConventionalMove() |
(package private) java.util.List<CreatureType> |
listTeleportingLords(MasterHex hex)
List the lords eligible to teleport this legion to hexLabel.
|
(package private) void |
moveToHex(MasterHex hex,
EntrySide entrySide,
boolean teleported,
CreatureType teleportingLord) |
(package private) boolean |
moveToTop(CreatureServerSide critter)
Move critter to the first position in the critters list.
|
(package private) void |
prepareToRemove(boolean returnCrittersToStacks,
boolean updateHistory)
Do the cleanup required before this legion can be removed.
|
(package private) void |
prepareToRemoveCritter(Creature critter,
boolean returnToStacks,
boolean updateHistory)
Do the cleanup associated with removing the critter from this
legion.
|
(package private) void |
recombine(Legion legion,
boolean remove)
Recombine this legion into another legion.
|
(package private) void |
remove() |
(package private) void |
remove(boolean returnCrittersToStacks,
boolean updateHistory)
Eliminate this legion.
|
void |
removeCreature(CreatureType type) |
(package private) CreatureType |
removeCreature(CreatureType creature,
boolean returnImmortalToStack,
boolean disbandIfEmpty)
Remove the first creature matching the passed creature's type
from the legion.
|
(package private) CreatureType |
removeCreature(int i,
boolean returnToStack,
boolean disbandIfEmpty)
Remove the creature in position i in the legion.
|
(package private) void |
sortCritters()
Sort critters into descending order of importance.
|
(package private) LegionServerSide |
split(java.util.List<CreatureType> creatures,
java.lang.String newMarkerId)
Split off creatures into a new legion using legion marker markerId.
|
(package private) void |
undoMove() |
(package private) void |
undoRecruit() |
(package private) void |
undoReinforcement() |
canFlee, contains, equals, findEligibleAngels, getCreatureTypes, getCurrentHex, getEntrySide, getHeight, getLongMarkerId, getMarkerId, getRecruit, getSkipThisTime, getTitan, getVisitedThisPhase, hashCode, hasMoved, hasRecruited, hasSummonable, hasTeleported, hasTitan, numCreature, numLords, numRangestrikers, setCurrentHex, setEntrySide, setMoved, setRecruit, setSkipThisTime, setTeleported, setupAcquirableDecisions, setVisitedThisPhase, toString
private static final java.util.logging.Logger LOGGER
private final Legion parent
private MasterHex startingHex
private int battleTally
Creature
or CreatureType
private final GameServerSide game
public LegionServerSide(java.lang.String markerId, Legion parent, MasterHex currentHex, MasterHex startingHex, Player player, GameServerSide game, CreatureType... creatureTypes)
public int getPointValue()
Legion
getPointValue
in class Legion
public void askAcquirablesDecisions()
void addAngel(CreatureType angelType)
int getBattleTally()
void clearBattleTally()
void clearBattleInfo()
void addToBattleTally(int points)
void addBattleTallyToPoints()
public java.lang.String getMarkerName()
public static java.lang.String getMarkerName(java.lang.String markerId)
public static java.lang.String getLongMarkerName(java.lang.String markerId)
public java.lang.String getLongMarkerName()
public Legion getParent()
public PlayerServerSide getPlayer()
Legion
void remove(boolean returnCrittersToStacks, boolean updateHistory)
void remove()
void prepareToRemove(boolean returnCrittersToStacks, boolean updateHistory)
void moveToHex(MasterHex hex, EntrySide entrySide, boolean teleported, CreatureType teleportingLord)
boolean hasConventionalMove()
void undoMove()
void commitMove()
boolean canRecruit()
void undoRecruit()
void editRemoveCreature(CreatureType creature)
void undoReinforcement()
boolean canSummonAngel()
MasterHex getStartingHex()
boolean addCreature(CreatureType creature, boolean takeFromStack)
CreatureType removeCreature(int i, boolean returnToStack, boolean disbandIfEmpty)
CreatureType removeCreature(CreatureType creature, boolean returnImmortalToStack, boolean disbandIfEmpty)
void prepareToRemoveCritter(Creature critter, boolean returnToStacks, boolean updateHistory)
public java.util.List<CreatureServerSide> getCreatures()
Legion
getCreatures
in class Legion
CreatureServerSide getCritter(int i)
void addCritter(CreatureServerSide critter)
CreatureServerSide getCritterByTag(int tag)
boolean moveToTop(CreatureServerSide critter)
Creature getCritter(CreatureType creatureType)
void sortCritters()
void recombine(Legion legion, boolean remove)
LegionServerSide split(java.util.List<CreatureType> creatures, java.lang.String newMarkerId)
java.util.List<CreatureType> listTeleportingLords(MasterHex hex)
public int compareTo(LegionServerSide other)
compareTo
in interface java.lang.Comparable<LegionServerSide>
public void addCreature(CreatureType type)
addCreature
in class Legion
public void removeCreature(CreatureType type)
removeCreature
in class Legion