public final class BattleUnit extends java.lang.Object implements BattleCritter
Modifier and Type | Class and Description |
---|---|
class |
BattleUnit.Listener
Listeners who needs to be notified if (currently) hits or dead values
change, to trigger repaint: a GUIBattleChit representing this creature
|
Modifier and Type | Field and Description |
---|---|
private CreatureType |
creatureType |
private BattleHex |
currentHex |
private boolean |
dead |
private boolean |
defender |
private int |
hits |
private java.lang.String |
id |
private Legion |
legion |
private java.util.Set<BattleUnit.Listener> |
listeners
Listeners to be informed when something changes, e.g.
|
private static java.util.logging.Logger |
LOGGER |
private boolean |
moved |
private int |
poison |
private int |
poisonDamage |
private int |
slowed |
private int |
slows |
private BattleHex |
startingHex |
private boolean |
struck |
private int |
tag |
Constructor and Description |
---|
BattleUnit(java.lang.String id,
boolean defender,
int tag,
BattleHex currentHex,
CreatureType type,
Legion legion) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(BattleUnit.Listener listener) |
void |
addPoisonDamage(int damage) |
void |
addSlowed(int slowValue) |
BattleHex |
getCurrentHex() |
java.lang.String |
getDescription() |
int |
getHits() |
java.lang.String |
getId() |
int |
getIdBasedTitanPower() |
Legion |
getLegion() |
int |
getPointValue() |
int |
getPoison() |
int |
getPoisonDamage() |
int |
getPower() |
int |
getSkill() |
int |
getSlowed() |
int |
getSlows() |
BattleHex |
getStartingHex() |
int |
getTag() |
int |
getTitanPower() |
int |
getTitanPowerViaLegionAndPlayer() |
CreatureType |
getType() |
boolean |
hasMoved() |
boolean |
hasStruck() |
boolean |
isDead() |
boolean |
isDefender() |
boolean |
isDemiLord() |
boolean |
isLord() |
boolean |
isRangestriker() |
boolean |
isTitan() |
void |
moveToHex(BattleHex hex) |
void |
notifyListeners() |
void |
removeListener(BattleUnit.Listener listener) |
void |
setCurrentHex(BattleHex hex) |
void |
setDead(boolean dead) |
void |
setHits(int hits) |
void |
setMoved(boolean moved) |
void |
setPoison(int damage) |
void |
setPoisonDamage(int damage) |
void |
setSlowed(int slowValue) |
void |
setSlows(int slowValue) |
void |
setStruck(boolean struck) |
java.lang.String |
toString() |
boolean |
useMagicMissile() |
boolean |
wouldDieFrom(int hits) |
private static final java.util.logging.Logger LOGGER
private final int tag
private final java.lang.String id
private final boolean defender
private final CreatureType creatureType
private final Legion legion
private int hits
private int poisonDamage
private int poison
private int slows
private int slowed
private BattleHex currentHex
private BattleHex startingHex
private boolean moved
private boolean struck
private boolean dead
private final java.util.Set<BattleUnit.Listener> listeners
public BattleUnit(java.lang.String id, boolean defender, int tag, BattleHex currentHex, CreatureType type, Legion legion)
public Legion getLegion()
public int getTag()
getTag
in interface BattleCritter
public int getHits()
getHits
in interface BattleCritter
public void setHits(int hits)
setHits
in interface BattleCritter
public void setPoison(int damage)
public void setPoisonDamage(int damage)
setPoisonDamage
in interface BattleCritter
public void addPoisonDamage(int damage)
addPoisonDamage
in interface BattleCritter
public void setSlowed(int slowValue)
setSlowed
in interface BattleCritter
public void addSlowed(int slowValue)
addSlowed
in interface BattleCritter
public void setSlows(int slowValue)
public boolean wouldDieFrom(int hits)
wouldDieFrom
in interface BattleCritter
public void setDead(boolean dead)
setDead
in interface BattleCritter
public boolean isDead()
isDead
in interface BattleCritter
public BattleHex getCurrentHex()
getCurrentHex
in interface BattleCritter
public BattleHex getStartingHex()
getStartingHex
in interface BattleCritter
public void setCurrentHex(BattleHex hex)
setCurrentHex
in interface BattleCritter
public void moveToHex(BattleHex hex)
moveToHex
in interface BattleCritter
public boolean hasMoved()
hasMoved
in interface BattleCritter
public void setMoved(boolean moved)
setMoved
in interface BattleCritter
public boolean hasStruck()
hasStruck
in interface BattleCritter
public void setStruck(boolean struck)
setStruck
in interface BattleCritter
public CreatureType getType()
getType
in interface BattleCritter
public boolean isDefender()
isDefender
in interface BattleCritter
public java.lang.String getId()
public boolean isTitan()
isTitan
in interface BattleCritter
public boolean isLord()
isLord
in interface BattleCritter
public boolean isDemiLord()
isDemiLord
in interface BattleCritter
public int getPower()
getPower
in interface BattleCritter
public int getTitanPower()
getTitanPower
in interface BattleCritter
public int getIdBasedTitanPower()
public int getTitanPowerViaLegionAndPlayer()
public int getSkill()
getSkill
in interface BattleCritter
public int getPointValue()
getPointValue
in interface BattleCritter
public int getPoison()
getPoison
in interface BattleCritter
public int getPoisonDamage()
getPoisonDamage
in interface BattleCritter
public int getSlowed()
getSlowed
in interface BattleCritter
public int getSlows()
getSlows
in interface BattleCritter
public boolean isRangestriker()
isRangestriker
in interface BattleCritter
public boolean useMagicMissile()
useMagicMissile
in interface BattleCritter
public java.lang.String getDescription()
getDescription
in interface BattleCritter
public java.lang.String toString()
toString
in class java.lang.Object
public void addListener(BattleUnit.Listener listener)
public void removeListener(BattleUnit.Listener listener)
public void notifyListeners()