22 #include <yaml-cpp/yaml.h> 23 #include "../Battlescape/Position.h" 24 #include "../Battlescape/BattlescapeGame.h" 25 #include "../Mod/RuleItem.h" 26 #include "../Mod/Unit.h" 27 #include "../Mod/MapData.h" 29 #include "BattleItem.h" 38 class SavedBattleGame;
47 struct BattleUnitStatistics;
48 struct StatAdjustment;
50 enum UnitStatus {STATUS_STANDING, STATUS_WALKING, STATUS_FLYING, STATUS_TURNING, STATUS_AIMING, STATUS_COLLAPSING, STATUS_DEAD, STATUS_UNCONSCIOUS, STATUS_PANICKING, STATUS_BERSERK, STATUS_IGNORE_ME};
51 enum UnitFaction {FACTION_PLAYER, FACTION_HOSTILE, FACTION_NEUTRAL};
52 enum UnitSide {SIDE_FRONT, SIDE_LEFT, SIDE_RIGHT, SIDE_REAR, SIDE_UNDER};
53 enum UnitBodyPart {BODYPART_HEAD, BODYPART_TORSO, BODYPART_RIGHTARM, BODYPART_LEFTARM, BODYPART_RIGHTLEG, BODYPART_LEFTLEG};
62 static const int SPEC_WEAPON_MAX = 3;
64 UnitFaction _faction, _originalFaction;
65 UnitFaction _killedBy;
70 int _direction, _toDirection;
71 int _directionTurret, _toDirectionTurret;
72 int _verticalDirection;
75 int _walkPhase, _fallPhase;
76 std::vector<BattleUnit *> _visibleUnits, _unitsSpottedThisTurn;
77 std::vector<Tile *> _visibleTiles;
78 int _tu, _energy, _health, _morale, _stunlevel;
79 bool _kneeled, _floating, _dontReselect;
80 int _currentArmor[5], _maxArmor[5];
83 std::vector<BattleItem*> _inventory;
89 int _expBravery, _expReactions, _expFiring, _expThrowing, _expPsiSkill, _expPsiStrength, _expMelee;
90 int improveStat(
int exp)
const;
94 bool _hitByFire, _hitByAnything;
98 int _turnsSinceSpotted;
99 std::string _spawnUnit;
100 std::string _activeHand;
103 int _mindControllerID;
104 UnitSide _fatalShotSide;
105 UnitBodyPart _fatalShotBodyPart;
106 std::string _murdererWeapon, _murdererWeaponAmmo;
114 int _standHeight, _kneelHeight, _floatHeight;
115 std::vector<int> _deathSound;
116 int _value, _aggroSound, _moveSound;
117 int _intelligence, _aggression;
118 SpecialAbility _specab;
120 SoldierGender _gender;
122 std::vector<int> _loftempsSet;
128 bool _hidingForTurn, _floorAbove, _respawn;
129 MovementType _movementType;
130 std::vector<std::pair<Uint8, Uint8> > _recolor;
133 void setRecolor(
int basicLook,
int utileLook,
int rankLook);
135 static const int MAX_SOLDIER_ID = 1000000;
143 void load(
const YAML::Node& node);
145 YAML::Node
save()
const;
183 void lookAt(
int direction,
bool force =
false);
185 void turn(
bool turret =
false);
197 const std::vector<std::pair<Uint8, Uint8> > &
getRecolor()
const;
199 void kneel(
bool kneeled);
205 void aim(
bool aiming);
217 int damage(
Position relative,
int power, ItemDamageType type,
bool ignoreArmor =
false);
260 void setArmor(
int armor, UnitSide side);
310 bool isInExitArea(SpecialTileType stt = START_POINT)
const;
340 void heal(
int part,
int woundAmount,
int healthAmount);
350 std::wstring
getName(
Language *lang,
bool debugAppendId =
false)
const;
424 Unit *getUnitRules()
const {
return _unitRules; }
446 bool isSelectable(UnitFaction faction,
bool checkReselect,
bool checkInventory)
const;
464 void setHiding(
bool hiding) { _hidingForTurn = hiding; };
void allowReselect()
Reselect this unit.
Definition: BattleUnit.cpp:1733
void addReactionExp()
Adds one to the reaction exp counter.
Definition: BattleUnit.cpp:2103
BattleUnit * getCharging()
Get the units we are charging towards.
Definition: BattleUnit.cpp:2701
int getAggression() const
Get the unit's aggression.
Definition: BattleUnit.cpp:2521
void setVisible(bool flag)
Set whether this unit is visible.
Definition: BattleUnit.cpp:1812
int getId() const
Gets the BattleUnit's ID.
Definition: BattleUnit.cpp:476
void prepareNewTurn(bool fullProcess=true)
Prepare for a new turn.
Definition: BattleUnit.cpp:1626
int getCarriedWeight(BattleItem *draggingItem=0) const
Get the carried weight in strength units.
Definition: BattleUnit.cpp:2711
void setMindControllerId(int id)
Set the unit mind controller's id.
Definition: BattleUnit.cpp:3236
void setMurdererWeapon(const std::string &weapon)
Set the unit murderer's weapon.
Definition: BattleUnit.cpp:3209
void setFloorAbove(bool floor)
Set the flag for "floor above me" meaning stop rendering bubbles.
Definition: BattleUnit.cpp:2991
BattleItem * getMainHandWeapon(bool quickest=true) const
Gets the item in the main hand.
Definition: BattleUnit.cpp:1948
UnitFaction killedBy() const
Get the faction that killed this unit.
Definition: BattleUnit.cpp:2674
std::string getSpawnUnit() const
Gets the unit's spawn unit.
Definition: BattleUnit.cpp:2556
void setAIModule(AIModule *ai)
Set AI Module.
Definition: BattleUnit.cpp:1790
Position getLastPosition() const
Gets the unit's position.
Definition: BattleUnit.cpp:505
int getRankInt() const
get the rank integer
Definition: BattleUnit.cpp:2781
const std::vector< int > & getDeathSounds() const
Get the unit's death sounds.
Definition: BattleUnit.cpp:2466
void setDirection(int direction)
Sets the unit's direction 0-7.
Definition: BattleUnit.cpp:524
Definition: BattlescapeGame.h:43
bool isOut() const
The unit is out - either dead or unconscious.
Definition: BattleUnit.cpp:1285
bool addToVisibleUnits(BattleUnit *unit)
Add unit to visible units.
Definition: BattleUnit.cpp:1405
int getSpecialAbility() const
Get the units's special ability.
Definition: BattleUnit.cpp:2530
void breathe()
Start breathing and/or update the breathing frame.
Definition: BattleUnit.cpp:2956
std::vector< BattleUnit * > * getVisibleUnits()
Get the list of visible units.
Definition: BattleUnit.cpp:1435
std::vector< Tile * > * getVisibleTiles()
Get the list of visible tiles.
Definition: BattleUnit.cpp:1463
BattleItem * getGrenadeFromBelt() const
Gets a grenade from the belt, if any.
Definition: BattleUnit.cpp:2028
bool getRespawn() const
Get the units's respawn flag.
Definition: BattleUnit.cpp:2547
std::string getActiveHand() const
Get unit's active hand.
Definition: BattleUnit.cpp:2619
bool checkAmmo()
Reloads righthand weapon if needed.
Definition: BattleUnit.cpp:2044
int getMotionPoints() const
Get motion points for the motion scanner.
Definition: BattleUnit.cpp:2360
void deriveRank()
derive a rank integer based on rank string (for xcom soldiers ONLY)
Definition: BattleUnit.cpp:2790
bool reselectAllowed() const
Check whether reselecting this unit is allowed.
Definition: BattleUnit.cpp:1743
void turn(bool turret=false)
Turn to the destination direction.
Definition: BattleUnit.cpp:798
bool isFearable() const
Get whether the unit is affected by fear.
Definition: BattleUnit.cpp:2503
void aim(bool aiming)
Aim.
Definition: BattleUnit.cpp:974
int getAccuracyModifier(BattleItem *item=0)
Calculate accuracy modifier.
Definition: BattleUnit.cpp:1530
void setTile(Tile *tile, Tile *tileBelow=0)
Sets the unit's tile it's standing on.
Definition: BattleUnit.cpp:1839
UnitFaction getFaction() const
Gets the unit's faction.
Definition: BattleUnit.cpp:895
void stimulant(int energy, int stun)
Give stimulant to this unit.
Definition: BattleUnit.cpp:2346
void setMurdererId(int id)
Set the unit murderer's id.
Definition: BattleUnit.cpp:3153
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:99
void setFaceDirection(int direction)
Sets the unit's face direction (only used by strafing moves)
Definition: BattleUnit.cpp:536
double getReactionScore()
Get the current reaction score.
Definition: BattleUnit.cpp:1615
int getTurnsSinceSpotted() const
Set how many turns this unit will be exposed for.
Definition: BattleUnit.cpp:2736
void convertToFaction(UnitFaction f)
Convert's unit to a faction.
Definition: BattleUnit.cpp:2630
void heal(int part, int woundAmount, int healthAmount)
Heal one fatal wound.
Definition: BattleUnit.cpp:2316
int getFire() const
Get fire.
Definition: BattleUnit.cpp:1762
void nerfFiringXP(int newXP)
Artificially alter a unit's firing xp. (used for shotguns)
Definition: BattleUnit.cpp:3261
void clearVisibleUnits()
Clear visible units.
Definition: BattleUnit.cpp:1443
void setPosition(Position pos, bool updateLastPos=true)
Sets the unit's position.
Definition: BattleUnit.cpp:486
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
UnitBodyPart getFatalShotBodyPart() const
Get information on the unit's fatal shot's body part.
Definition: BattleUnit.cpp:3191
std::string getRankString() const
Get the units's rank string.
Definition: BattleUnit.cpp:2574
Soldier * getGeoscapeSoldier() const
Get the geoscape-soldier object.
Definition: BattleUnit.cpp:2583
std::string getMurdererWeaponAmmo() const
Get the unit murderer's weapon's ammo.
Definition: BattleUnit.cpp:3218
int getTurretToDirection() const
Gets the unit's turret To direction.
Definition: BattleUnit.cpp:573
int getKneelHeight() const
Get the unit's kneel height.
Definition: BattleUnit.cpp:2428
int getMaxArmor(UnitSide side) const
Get max armor value.
Definition: BattleUnit.cpp:1593
void keepFalling()
Increment the falling sequence.
Definition: BattleUnit.cpp:1253
void adjustStats(const StatAdjustment &adjustment)
adjust this unit's stats according to difficulty.
Definition: BattleUnit.cpp:2861
void setTimeUnits(int tu)
Set time units.
Definition: BattleUnit.cpp:1395
void setEnergy(int energy)
Sets the unit's energy level.
Definition: BattleUnit.cpp:2665
bool tookFireDamage() const
did this unit already take fire damage this turn? (used to avoid damaging large units multiple times...
Definition: BattleUnit.cpp:2888
void setMurdererWeaponAmmo(const std::string &weaponAmmo)
Set the unit murderer's weapon's ammo.
Definition: BattleUnit.cpp:3227
void startWalking(int direction, Position destination, Tile *tileBelowMe, bool cache)
Start the walkingPhase.
Definition: BattleUnit.cpp:603
bool hasInventory() const
Does this unit have an inventory?
Definition: BattleUnit.cpp:2937
bool postMissionProcedures(SavedGame *geoscape, UnitStats &statsDiff)
Check if unit eligible for squaddie promotion.
Definition: BattleUnit.cpp:2161
void setRankInt(int rank)
set the rank integer
Definition: BattleUnit.cpp:2772
void toggleFireDamage()
switch the state of the fire damage tracker.
Definition: BattleUnit.cpp:2896
bool isKneeled() const
Is kneeled?
Definition: BattleUnit.cpp:956
Surface * getCache(bool *invalid, int part=0) const
If this unit is cached on the battlescape.
Definition: BattleUnit.cpp:925
int damage(Position relative, int power, ItemDamageType type, bool ignoreArmor=false)
Do damage to the unit.
Definition: BattleUnit.cpp:1078
void recoverTimeUnits()
Recovers the unit's time units and energy.
Definition: BattleUnit.cpp:3107
void lookAt(Position point, bool turret=false)
Look at a certain point.
Definition: BattleUnit.cpp:747
bool getVisible() const
Get whether this unit is visible.
Definition: BattleUnit.cpp:1822
int getAggroSound() const
Gets the unit's aggro sound.
Definition: BattleUnit.cpp:2656
void setCoverReserve(int reserve)
Changes the amount of TUs reserved for cover.
Definition: BattleUnit.cpp:2905
void resetHitState()
reset the unit hit state.
Definition: BattleUnit.cpp:3277
int getMurdererId() const
Get the unit murderer's id.
Definition: BattleUnit.cpp:3162
void addThrowingExp()
Adds one to the throwing exp counter.
Definition: BattleUnit.cpp:2119
UnitFaction getOriginalFaction() const
Get this unit's original faction.
Definition: BattleUnit.cpp:2745
void setSpecialWeapon(SavedBattleGame *save, const Mod *mod)
Create special weapon for unit.
Definition: BattleUnit.cpp:3061
void kneel(bool kneeled)
Kneel down.
Definition: BattleUnit.cpp:946
void healStun(int power)
Heal stun level of the unit.
Definition: BattleUnit.cpp:1209
bool isWoundable() const
Get whether the unit is affected by fatal wounds.
Definition: BattleUnit.cpp:2493
void painKillers()
Give pain killers to this unit.
Definition: BattleUnit.cpp:2331
void load(const YAML::Node &node)
Loads the unit from YAML.
Definition: BattleUnit.cpp:311
Represents a specific type of item.
Definition: RuleItem.h:40
void setCharging(BattleUnit *chargeTarget)
Set the units we are charging towards.
Definition: BattleUnit.cpp:2692
bool getHitState()
Was this unit just hit?
Definition: BattleUnit.cpp:3269
Contains strings used throughout the game for localization.
Definition: Language.h:39
bool isInExitArea(SpecialTileType stt=START_POINT) const
Check if this unit is in the exit area.
Definition: BattleUnit.cpp:2086
double getThrowingAccuracy()
Calculate throwing accuracy.
Definition: BattleUnit.cpp:1559
void addPsiSkillExp()
Adds one to the psi skill exp counter.
Definition: BattleUnit.cpp:2127
int getHealth() const
Gets the unit's health.
Definition: BattleUnit.cpp:1056
Represents a single item in the battlescape.
Definition: BattleItem.h:36
void addMeleeExp()
Adds one to the melee exp counter.
Definition: BattleUnit.cpp:2143
This class is used by the BattleUnit AI.
Definition: AIModule.h:40
std::string getType() const
Get unit type.
Definition: BattleUnit.cpp:2600
UnitSide getFatalShotSide() const
Get information on the unit's fatal shot's side.
Definition: BattleUnit.cpp:3182
int getTurretDirection() const
Gets the unit's turret direction.
Definition: BattleUnit.cpp:564
int getMorale() const
Gets the unit's bravery.
Definition: BattleUnit.cpp:1065
int getFloatHeight() const
Gets the unit floating elevation.
Definition: BattleUnit.cpp:2437
std::vector< BattleItem * > * getInventory()
Get the list of items in the inventory.
Definition: BattleUnit.cpp:1771
int getDiagonalWalkingPhase() const
Gets the walking phase for diagonal walking.
Definition: BattleUnit.cpp:737
BattleUnitStatistics * getStatistics()
Get the unit's mission statistics.
Definition: BattleUnit.cpp:3144
void setTurretType(int turretType)
Set the turret type. -1 is no turret.
Definition: BattleUnit.cpp:2284
void setHiding(bool hiding)
Sets this unit is in hiding for a turn (or not).
Definition: BattleUnit.h:464
BattleItem * getItem(RuleInventory *slot, int x=0, int y=0) const
Gets the item in the specified slot.
Definition: BattleUnit.cpp:1881
UnitStats * getBaseStats()
Gets the unit's stats.
Definition: BattleUnit.cpp:2410
int getWalkingPhase() const
Gets the walking phase for animation and sound.
Definition: BattleUnit.cpp:728
void addPsiStrengthExp()
Adds one to the psi strength exp counter.
Definition: BattleUnit.cpp:2135
int getCoverReserve() const
Returns the amount of TUs reserved for cover.
Definition: BattleUnit.cpp:2914
void setArmor(int armor, UnitSide side)
Set armor value.
Definition: BattleUnit.cpp:1569
Represents a specific type of armor.
Definition: Armor.h:35
void setFire(int fire)
Set fire.
Definition: BattleUnit.cpp:1752
void setActiveHand(const std::string &slot)
Set the hand this unit is using;.
Definition: BattleUnit.cpp:2609
Represents a soldier hired by the player.
Definition: Soldier.h:48
Tile * getTile() const
Gets the unit's tile.
Definition: BattleUnit.cpp:1868
int getActionTUs(BattleActionType actionType, BattleItem *item)
Get the number of time units a certain action takes.
Definition: BattleUnit.cpp:1296
void addFiringExp()
Adds one to the firing exp counter.
Definition: BattleUnit.cpp:2111
void addKillCount()
Add a kill to the counter.
Definition: BattleUnit.cpp:2591
void goToTimeOut()
Puts the unit in the corner to think about what he's done.
Definition: BattleUnit.cpp:3041
int getTurretType() const
Get the turret type. -1 is no turret.
Definition: BattleUnit.cpp:2293
Basic element of which a battle map is build.
Definition: Tile.h:42
This struct holds some plain unit attribute data together.
Definition: Unit.h:30
Element that is blit (rendered) onto the screen.
Definition: Surface.h:36
int getMoveSound() const
Get the unit's move sound.
Definition: BattleUnit.cpp:2482
int getDirection() const
Gets the unit's direction.
Definition: BattleUnit.cpp:545
bool addToVisibleTiles(Tile *tile)
Add unit to visible tiles.
Definition: BattleUnit.cpp:1453
bool isHiding() const
Checks if this unit is in hiding for a turn.
Definition: BattleUnit.h:462
YAML::Node save() const
Saves the unit to YAML.
Definition: BattleUnit.cpp:377
int directionTo(Position point) const
Get direction to a certain point.
Definition: BattleUnit.cpp:990
int getFiringXP() const
Get the unit's total firing xp for this mission.
Definition: BattleUnit.cpp:3253
const std::vector< std::pair< Uint8, Uint8 > > & getRecolor() const
Gets unit sprite recolors values.
Definition: BattleUnit.cpp:937
void setFatalShotInfo(UnitSide side, UnitBodyPart bodypart)
Set information on the unit's fatal shot.
Definition: BattleUnit.cpp:3172
BattleItem * getSpecialWeapon(BattleType type) const
Get special weapon.
Definition: BattleUnit.cpp:3092
int getStunlevel() const
Gets the unit's stun level.
Definition: BattleUnit.cpp:1215
void instaKill()
Set health to 0 and set status dead.
Definition: BattleUnit.cpp:2646
AIModule * getAIModule() const
Get AI Module.
Definition: BattleUnit.cpp:1803
void kill()
Set health to 0.
Definition: BattleUnit.cpp:2638
void clearVisibleTiles()
Clear visible tiles.
Definition: BattleUnit.cpp:1471
bool spendTimeUnits(int tu)
Spend time units if it can.
Definition: BattleUnit.cpp:1358
int getValue() const
Get the unit's value.
Definition: BattleUnit.cpp:2457
BattleItem * getMeleeWeapon()
Get any melee weapon we may be carrying, or a built in one.
Definition: BattleUnit.cpp:3009
int getFatalWound(int part) const
Get fatal wound amount of a body part.
Definition: BattleUnit.cpp:2303
void invalidateCache()
call this after the default copy constructor deletes the cache?
Definition: BattleUnit.cpp:2753
int getFiringAccuracy(BattleActionType actionType, BattleItem *item)
Calculate firing accuracy.
Definition: BattleUnit.cpp:1488
BattleUnit(Soldier *soldier, int depth)
Creates a BattleUnit from solder.
Definition: BattleUnit.cpp:49
Battlescape game - the core game engine of the battlescape game.
Definition: BattlescapeGame.h:68
void keepWalking(Tile *tileBelowMe, bool cache)
Increase the walkingPhase.
Definition: BattleUnit.cpp:647
int getStandHeight() const
Get the unit's stand height.
Definition: BattleUnit.cpp:2419
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:47
int getFatalWounds() const
Get total number of fatal wounds.
Definition: BattleUnit.cpp:1602
std::vector< BattleUnit * > & getUnitsSpottedThisTurn()
get the vector of units we've seen this turn.
Definition: BattleUnit.cpp:2763
int getIntelligence() const
Get the unit's intelligence.
Definition: BattleUnit.cpp:2512
void setSpawnUnit(const std::string &spawnUnit)
Sets the unit's spawn unit.
Definition: BattleUnit.cpp:2565
Container for battle unit statistics.
Definition: BattleUnitStatistics.h:304
void moraleChange(int change)
Morale change.
Definition: BattleUnit.cpp:1711
int getFallingPhase() const
Get falling sequence.
Definition: BattleUnit.cpp:1275
void think(BattleAction *action)
Let AI do their thing.
Definition: BattleUnit.cpp:1780
int getEnergy() const
Gets the unit's stamina.
Definition: BattleUnit.cpp:1047
std::wstring getName(Language *lang, bool debugAppendId=false) const
Gets the unit's name.
Definition: BattleUnit.cpp:2383
int getLoftemps(int entry=0) const
Get the unit's loft ID.
Definition: BattleUnit.cpp:2448
bool isSelectable(UnitFaction faction, bool checkReselect, bool checkInventory) const
Is this unit selectable?
Definition: BattleUnit.cpp:2927
Armor * getArmor() const
Gets the unit's armor.
Definition: BattleUnit.cpp:2370
Easy handling of X-Y-Z coordinates.
Definition: Position.h:28
bool spendEnergy(int tu)
Spend energy if it can.
Definition: BattleUnit.cpp:1376
~BattleUnit()
Cleans up the BattleUnit.
Definition: BattleUnit.cpp:295
UnitStatus getStatus() const
Gets the unit's status.
Definition: BattleUnit.cpp:591
bool getFloorAbove() const
Get the flag for "floor above me".
Definition: BattleUnit.cpp:3000
int getHeight() const
Gets the unit height taking into account kneeling/standing.
Definition: BattleUnit.cpp:2095
bool checkViewSector(Position pos) const
this function checks if a tile is visible, using maths.
Definition: BattleUnit.cpp:2812
MovementType getMovementType() const
Use this function to check the unit's movement type.
Definition: BattleUnit.cpp:3032
int getTimeUnits() const
Gets the unit's time units.
Definition: BattleUnit.cpp:1038
SoldierGender getGender() const
Gets the soldier's gender.
Definition: BattleUnit.cpp:886
void setTurnsSinceSpotted(int turns)
Set how many turns this unit will be exposed for.
Definition: BattleUnit.cpp:2727
Position getPosition() const
Gets the unit's position.
Definition: BattleUnit.cpp:496
int getMindControllerId() const
Get the unit mind controller's id.
Definition: BattleUnit.cpp:3245
void setRespawn(bool respawn)
Set the units's respawn flag.
Definition: BattleUnit.cpp:2539
void abortTurn()
Abort turning.
Definition: BattleUnit.cpp:877
void dontReselect()
Don't reselect this unit.
Definition: BattleUnit.cpp:1725
int getMiniMapSpriteIndex() const
Get the sprite index for the minimap.
Definition: BattleUnit.cpp:2247
bool isFloating() const
Is floating?
Definition: BattleUnit.cpp:965
int getBreathFrame() const
Is this unit breathing and if so what frame?
Definition: BattleUnit.cpp:2946
int getFaceDirection() const
Gets the unit's face direction (only used by strafing moves)
Definition: BattleUnit.cpp:555
int getVerticalDirection() const
Gets the unit's vertical direction.
Definition: BattleUnit.cpp:582
void knockOut(BattlescapeGame *battle)
Knocks the unit out instantly.
Definition: BattleUnit.cpp:1226
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:59
void updateGeoscapeStats(Soldier *soldier) const
Updates the stats of a Geoscape soldier.
Definition: BattleUnit.cpp:2148
std::string getMurdererWeapon() const
Get the unit murderer's weapon.
Definition: BattleUnit.cpp:3200
Definition: BaseInfoState.cpp:40
Represents the static data for a unit that is generated on the battlescape, this includes: HWPs...
Definition: Unit.h:57
Represents a specific section of the inventory, containing information like available slots and scree...
Definition: RuleInventory.h:42
void startFalling()
Start falling sequence.
Definition: BattleUnit.cpp:1243
Position getDestination() const
Gets the unit's destination when walking.
Definition: BattleUnit.cpp:514
void setCache(Surface *cache, int part=0)
Set the cached flag.
Definition: BattleUnit.cpp:905