OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::Unit Class Reference

Represents the static data for a unit that is generated on the battlescape, this includes: HWPs, aliens and civilians. More...

#include <Unit.h>

Public Member Functions

 Unit (const std::string &type)
 Creates a blank unit ruleset. More...
 
 ~Unit ()
 Cleans up the unit ruleset.
 
void load (const YAML::Node &node, int modIndex)
 Loads the unit data from YAML. More...
 
std::string getType () const
 Gets the unit's type. More...
 
UnitStatsgetStats ()
 Gets the unit's stats. More...
 
int getStandHeight () const
 Gets the unit's height when standing. More...
 
int getKneelHeight () const
 Gets the unit's height when kneeling. More...
 
int getFloatHeight () const
 Gets the unit's float elevation. More...
 
std::string getArmor () const
 Gets the armor type. More...
 
std::string getRace () const
 Gets the alien race type. More...
 
std::string getRank () const
 Gets the alien rank. More...
 
int getValue () const
 Gets the value - for score calculation. More...
 
int getDeathSound () const
 Gets the death sound id. More...
 
int getMoveSound () const
 Gets the move sound id. More...
 
int getIntelligence () const
 Gets the intelligence. This is the number of turns AI remembers your troop positions. More...
 
int getAggression () const
 Gets the aggression. Determines the chance of revenge and taking cover. More...
 
int getSpecialAbility () const
 Gets the alien's special ability. More...
 
std::string getSpawnUnit () const
 Gets the unit's spawn unit. More...
 
int getAggroSound () const
 Gets the unit's war cry. More...
 
bool isLivingWeapon () const
 Checks if this unit has a built in weapon. More...
 

Detailed Description

Represents the static data for a unit that is generated on the battlescape, this includes: HWPs, aliens and civilians.

See also
Soldier BattleUnit

Constructor & Destructor Documentation

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

Creates a blank unit ruleset.

Creates a certain type of unit.

Parameters
typeString defining the type.

Member Function Documentation

int OpenXcom::Unit::getAggression ( ) const

Gets the aggression. Determines the chance of revenge and taking cover.

Gets the aggression.

Determines the chance of revenge and taking cover.

Returns
The unit's aggression.
int OpenXcom::Unit::getAggroSound ( ) const

Gets the unit's war cry.

Returns
The id of the unit's aggro sound.
std::string OpenXcom::Unit::getArmor ( ) const

Gets the armor type.

Gets the unit's armor type.

Returns
The unit's armor type.
int OpenXcom::Unit::getDeathSound ( ) const

Gets the death sound id.

Gets the unit's death sound.

Returns
The id of the unit's death sound.
int OpenXcom::Unit::getFloatHeight ( ) const

Gets the unit's float elevation.

Returns the unit's floating elevation.

Returns
The unit's floating height.
int OpenXcom::Unit::getIntelligence ( ) const

Gets the intelligence. This is the number of turns AI remembers your troop positions.

Gets the intelligence.

This is the number of turns the AI remembers your troop positions.

Returns
The unit's intelligence.
int OpenXcom::Unit::getKneelHeight ( ) const

Gets the unit's height when kneeling.

Returns the unit's height at kneeling.

Returns
The unit's kneeling height.
int OpenXcom::Unit::getMoveSound ( ) const

Gets the move sound id.

Gets the unit's move sound.

Returns
The id of the unit's move sound.
std::string OpenXcom::Unit::getRace ( ) const

Gets the alien race type.

Gets the alien's race.

Returns
The alien's race.
std::string OpenXcom::Unit::getRank ( ) const

Gets the alien rank.

Gets the unit's rank.

Returns
The unit's rank.
std::string OpenXcom::Unit::getSpawnUnit ( ) const

Gets the unit's spawn unit.

Gets the unit that is spawned when this one dies.

Returns
The unit's spawn unit.
int OpenXcom::Unit::getSpecialAbility ( ) const

Gets the alien's special ability.

Gets the unit's special ability.

Returns
The unit's specab.
int OpenXcom::Unit::getStandHeight ( ) const

Gets the unit's height when standing.

Returns the unit's height at standing.

Returns
The unit's height.
UnitStats * OpenXcom::Unit::getStats ( )

Gets the unit's stats.

Returns the unit's stats data object.

Returns
The unit's stats.
std::string OpenXcom::Unit::getType ( ) const

Gets the unit's type.

Returns the language string that names this unit.

Each unit type has a unique name.

Returns
The unit's name.
int OpenXcom::Unit::getValue ( ) const

Gets the value - for score calculation.

Gets the unit's value - for scoring.

Returns
The unit's value.
bool OpenXcom::Unit::isLivingWeapon ( ) const

Checks if this unit has a built in weapon.

Checks if this unit is a living weapon.

(ie: chryssalid).

Returns
True if this unit is a living weapon.
void OpenXcom::Unit::load ( const YAML::Node &  node,
int  modIndex 
)

Loads the unit data from YAML.

Loads the unit from a YAML file.

Parameters
modIndexA value that offsets the sounds and sprite values to avoid conflicts.
nodeYAML node.

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