19 #ifndef OPENXCOM_SOLDIER_H
20 #define OPENXCOM_SOLDIER_H
23 #include <yaml-cpp/yaml.h>
24 #include "../Ruleset/Unit.h"
25 #include "../Ruleset/StatString.h"
30 enum SoldierRank { RANK_ROOKIE, RANK_SQUADDIE, RANK_SERGEANT, RANK_CAPTAIN, RANK_COLONEL, RANK_COMMANDER};
31 enum SoldierGender { GENDER_MALE, GENDER_FEMALE };
32 enum SoldierLook { LOOK_BLONDE, LOOK_BROWNHAIR, LOOK_ORIENTAL, LOOK_AFRICAN };
35 class SoldierNamePool;
40 class EquipmentLayoutItem;
53 int _id, _improvement;
58 SoldierGender _gender;
60 int _missions, _kills, _recovery;
61 bool _recentlyPromoted, _psiTraining;
63 std::vector<EquipmentLayoutItem*> _equipmentLayout;
65 std::wstring _statString;
74 YAML::Node
save()
const;
76 std::wstring
getName(
bool statstring =
false,
unsigned int maxLength = 20)
const;
78 void setName(
const std::wstring &name);
142 void calcStatString(
const std::vector<StatString *> &statStrings,
bool psiStrengthEval);
void addKillCount(int count)
Add a kill to the counter.
Definition: Soldier.cpp:371
bool isPromoted()
Get whether the unit was recently promoted.
Definition: Soldier.cpp:396
Represents a craft stored in a base.
Definition: Craft.h:44
UnitStats * getInitStats()
Get pointer to initial stats.
Definition: Soldier.cpp:379
int getRankSprite() const
Gets a sprite version of the soldier's rank.
Definition: Soldier.cpp:277
void addMissionCount()
Add a mission to the counter.
Definition: Soldier.cpp:363
void setPsiTraining()
set the psi training status
Definition: Soldier.cpp:530
SoldierLook getLook() const
Gets the soldier's look.
Definition: Soldier.cpp:336
void setCraft(Craft *craft)
Sets the soldier's craft.
Definition: Soldier.cpp:215
Stores info about a soldier's death.
Definition: SoldierDeath.h:33
void trainPsi1Day()
Trains a soldier's psionic abilities (anytimePsiTraining option).
Definition: Soldier.cpp:490
std::vector< EquipmentLayoutItem * > * getEquipmentLayout()
Gets the soldier's equipment-layout.
Definition: Soldier.cpp:457
RuleSoldier * getRules() const
Gets soldier rules.
Definition: Soldier.cpp:345
Armor * getArmor() const
Gets the soldier armor.
Definition: Soldier.cpp:407
UnitStats * getCurrentStats()
Get pointer to current stats.
Definition: Soldier.cpp:387
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:80
bool isInPsiTraining()
Returns whether the unit is in psi training or not.
Definition: Soldier.cpp:522
void trainPsi()
Trains a soldier's psychic stats.
Definition: Soldier.cpp:465
SoldierGender getGender() const
Gets the soldier's gender.
Definition: Soldier.cpp:327
int getWoundRecovery() const
Gets the soldier's wound recovery time.
Definition: Soldier.cpp:425
void setArmor(Armor *armor)
Sets the soldier armor.
Definition: Soldier.cpp:416
SoldierDeath * getDeath() const
Gets the soldier death info.
Definition: Soldier.cpp:548
void heal()
Heals wound recoveries.
Definition: Soldier.cpp:448
void die(SoldierDeath *death)
Kills the soldier.
Definition: Soldier.cpp:557
void setWoundRecovery(int recovery)
Sets the soldier's wound recovery time.
Definition: Soldier.cpp:434
Contains strings used throughout the game for localization.
Definition: Language.h:42
Set of rules and stats for a game.
Definition: Ruleset.h:69
void calcStatString(const std::vector< StatString * > &statStrings, bool psiStrengthEval)
Calculate statString.
Definition: Soldier.cpp:579
void load(const YAML::Node &node, const Ruleset *rule, SavedGame *save)
Loads the soldier from YAML.
Definition: Soldier.cpp:97
std::string getRankString() const
Gets a string version of the soldier's rank.
Definition: Soldier.cpp:250
void setName(const std::wstring &name)
Sets the soldier's name.
Definition: Soldier.cpp:197
Represents a specific type of armor.
Definition: Armor.h:36
Represents a soldier hired by the player.
Definition: Soldier.h:49
This struct holds some plain unit attribute data together.
Definition: Unit.h:32
SoldierRank getRank() const
Gets the soldier's rank.
Definition: Soldier.cpp:287
int getMissions() const
Gets the soldier's missions.
Definition: Soldier.cpp:309
Represents the creation data for a specific type of unit.
Definition: RuleSoldier.h:33
int getId() const
Gets the soldier's unique ID.
Definition: Soldier.cpp:355
YAML::Node save() const
Saves the soldier to YAML.
Definition: Soldier.cpp:134
~Soldier()
Cleans up the soldier.
Definition: Soldier.cpp:82
Craft * getCraft() const
Gets the soldier's craft.
Definition: Soldier.cpp:206
std::wstring getCraftString(Language *lang) const
Gets the soldier's craft string.
Definition: Soldier.cpp:227
int getKills() const
Gets the soldier's kills.
Definition: Soldier.cpp:318
std::wstring getName(bool statstring=false, unsigned int maxLength=20) const
Gets the soldier's name.
Definition: Soldier.cpp:174
Soldier(RuleSoldier *rules, Armor *armor, const std::vector< SoldierNamePool * > *names=0, int id=0)
Creates a new soldier.
Definition: Soldier.cpp:43
int getImprovement()
returns this soldier's psionic improvement score for this month.
Definition: Soldier.cpp:539
void promoteRank()
Increase the soldier's military rank.
Definition: Soldier.cpp:295