OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::RuleSoldier Class Reference

Represents the creation data for an X-COM unit. More...

#include <RuleSoldier.h>

Public Member Functions

 RuleSoldier (const std::string &type)
 Creates a blank soldier ruleset. More...
 
 ~RuleSoldier ()
 Cleans up the soldier ruleset.
 
void load (const YAML::Node &node, Mod *mod)
 Loads the soldier data from YAML. More...
 
std::string getType () const
 Gets the soldier's type. More...
 
const std::vector< std::string > & getRequirements () const
 Gets the soldier's requirements. More...
 
UnitStats getMinStats () const
 Gets the minimum stats for the random stats generator. More...
 
UnitStats getMaxStats () const
 Gets the maximum stats for the random stats generator. More...
 
UnitStats getStatCaps () const
 Gets the stat caps. More...
 
int getBuyCost () const
 Gets the cost of the soldier. More...
 
int getSalaryCost () const
 Gets the monthly salary of the soldier. More...
 
int getStandHeight () const
 Gets the height of the soldier when it's standing. More...
 
int getKneelHeight () const
 Gets the height of the soldier when it's kneeling. More...
 
int getFloatHeight () const
 Gets the elevation of the soldier when it's flying. More...
 
std::string getArmor () const
 Gets the default-equipped armor. More...
 
int getFemaleFrequency () const
 Gets the female appearance ratio. More...
 
const std::vector< int > & getMaleDeathSounds () const
 Gets the soldier's male death sounds. More...
 
const std::vector< int > & getFemaleDeathSounds () const
 Gets the soldier's female death sounds. More...
 
const std::vector< SoldierNamePool * > & getNames () const
 Gets the pool list for soldier names. More...
 
int getValue () const
 Gets the value - for score calculation. More...
 
int getTransferTime () const
 Gets the soldier's transfer time. More...
 

Detailed Description

Represents the creation data for an X-COM unit.

This info is copied to either Soldier for Geoscape or BattleUnit for Battlescape.

See also
Soldier BattleUnit

Constructor & Destructor Documentation

◆ RuleSoldier()

OpenXcom::RuleSoldier::RuleSoldier ( const std::string &  type)

Creates a blank soldier ruleset.

Creates a blank ruleunit for a certain type of soldier.

Parameters
typeString defining the type.

Member Function Documentation

◆ getArmor()

std::string OpenXcom::RuleSoldier::getArmor ( ) const

Gets the default-equipped armor.

Gets the default armor name.

Returns
The armor name.

◆ getBuyCost()

int OpenXcom::RuleSoldier::getBuyCost ( ) const

Gets the cost of the soldier.

Gets the cost of hiring this soldier.

Returns
The cost.

◆ getFemaleDeathSounds()

const std::vector< int > & OpenXcom::RuleSoldier::getFemaleDeathSounds ( ) const

Gets the soldier's female death sounds.

Gets the death sounds for female soldiers.

Returns
List of sound IDs.

◆ getFemaleFrequency()

int OpenXcom::RuleSoldier::getFemaleFrequency ( ) const

Gets the female appearance ratio.

Returns
The percentage ratio.

◆ getFloatHeight()

int OpenXcom::RuleSoldier::getFloatHeight ( ) const

Gets the elevation of the soldier when it's flying.

Returns
The floating height.

◆ getKneelHeight()

int OpenXcom::RuleSoldier::getKneelHeight ( ) const

Gets the height of the soldier when it's kneeling.

Returns
The kneeling height.

◆ getMaleDeathSounds()

const std::vector< int > & OpenXcom::RuleSoldier::getMaleDeathSounds ( ) const

Gets the soldier's male death sounds.

Gets the death sounds for male soldiers.

Returns
List of sound IDs.

◆ getMaxStats()

UnitStats OpenXcom::RuleSoldier::getMaxStats ( ) const

Gets the maximum stats for the random stats generator.

Returns
The maximum stats.

◆ getMinStats()

UnitStats OpenXcom::RuleSoldier::getMinStats ( ) const

Gets the minimum stats for the random stats generator.

Returns
The minimum stats.

◆ getNames()

const std::vector< SoldierNamePool * > & OpenXcom::RuleSoldier::getNames ( ) const

Gets the pool list for soldier names.

Returns the list of soldier name pools.

Returns
Pointer to soldier name pool list.

◆ getRequirements()

const std::vector< std::string > & OpenXcom::RuleSoldier::getRequirements ( ) const

Gets the soldier's requirements.

Gets the list of research required to acquire this soldier.

Returns
The list of research IDs.

◆ getSalaryCost()

int OpenXcom::RuleSoldier::getSalaryCost ( ) const

Gets the monthly salary of the soldier.

Gets the cost of salary for a month.

Returns
The cost.

◆ getStandHeight()

int OpenXcom::RuleSoldier::getStandHeight ( ) const

Gets the height of the soldier when it's standing.

Returns
The standing height.

◆ getStatCaps()

UnitStats OpenXcom::RuleSoldier::getStatCaps ( ) const

Gets the stat caps.

Returns
The stat caps.

◆ getTransferTime()

int OpenXcom::RuleSoldier::getTransferTime ( ) const

Gets the soldier's transfer time.

Gets the amount of time this item takes to arrive at a base.

Returns
The time in hours.

◆ getType()

std::string OpenXcom::RuleSoldier::getType ( ) const

Gets the soldier's type.

Returns the language string that names this soldier.

Each soldier type has a unique name.

Returns
Soldier name.

◆ getValue()

int OpenXcom::RuleSoldier::getValue ( ) const

Gets the value - for score calculation.

Gets the soldier's base value, without experience modifiers.

Returns
The soldier's value.

◆ load()

void OpenXcom::RuleSoldier::load ( const YAML::Node &  node,
Mod mod 
)

Loads the soldier data from YAML.

Loads the soldier from a YAML file.

Parameters
nodeYAML node.
modMod for the unit.

The documentation for this class was generated from the following files: