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::RuleBaseFacility Class Reference

Represents a specific type of base facility. More...

#include <RuleBaseFacility.h>

Public Member Functions

 RuleBaseFacility (const std::string &type)
 Creates a blank facility ruleset. More...
 
 ~RuleBaseFacility ()
 Cleans up the facility ruleset.
 
void load (const YAML::Node &node, int modIndex, int listOrder)
 Loads the facility from YAML. More...
 
std::string getType () const
 Gets the facility's type. More...
 
const std::vector< std::string > & getRequirements () const
 Gets the facility's requirements. More...
 
int getSpriteShape () const
 Gets the facility's shape sprite. More...
 
int getSpriteFacility () const
 Gets the facility's content sprite. More...
 
int getSize () const
 Gets the facility's size. More...
 
bool isLift () const
 Gets if the facility is an access lift. More...
 
bool isHyperwave () const
 Gets if the facility has hyperwave detection. More...
 
bool isMindShield () const
 Gets if the facility is a mind shield. More...
 
bool isGravShield () const
 Gets if the facility is a grav shield. More...
 
int getBuildCost () const
 Gets the facility's construction cost. More...
 
int getBuildTime () const
 Gets the facility's construction time. More...
 
int getMonthlyCost () const
 Gets the facility's monthly cost. More...
 
int getStorage () const
 Gets the facility's storage capacity. More...
 
int getPersonnel () const
 Gets the facility's personnel capacity. More...
 
int getAliens () const
 Gets the facility's alien capacity. More...
 
int getCrafts () const
 Gets the facility's craft capacity. More...
 
int getLaboratories () const
 Gets the facility's laboratory space. More...
 
int getWorkshops () const
 Gets the facility's workshop space. More...
 
int getPsiLaboratories () const
 Gets the facility's psi-training capacity. More...
 
int getRadarRange () const
 Gets the facility's radar range. More...
 
int getRadarChance () const
 Gets the facility's detection chance. More...
 
int getDefenseValue () const
 Gets the facility's defense value. More...
 
int getHitRatio () const
 Gets the facility's weapon hit ratio. More...
 
std::string getMapName () const
 Gets the facility's battlescape map name. More...
 
int getFireSound () const
 Gets the facility's fire sound. More...
 
int getHitSound () const
 Gets the facility's hit sound. More...
 
int getListOrder () const
 Gets the facility's list weight. More...
 

Detailed Description

Represents a specific type of base facility.

Contains constant info about a facility like costs, capacities, size, etc.

See also
BaseFacility

Constructor & Destructor Documentation

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

Creates a blank facility ruleset.

Creates a blank ruleset for a certain type of base facility.

Parameters
typeString defining the type.

Member Function Documentation

int OpenXcom::RuleBaseFacility::getAliens ( ) const

Gets the facility's alien capacity.

Gets the number of captured live aliens this facility can contain.

Returns
The number of aliens.
int OpenXcom::RuleBaseFacility::getBuildCost ( ) const

Gets the facility's construction cost.

Gets the amount of funds that this facility costs to build on a base.

Returns
The building cost.
int OpenXcom::RuleBaseFacility::getBuildTime ( ) const

Gets the facility's construction time.

Gets the amount of time that this facility takes to be constructed since placement.

Returns
The time in days.
int OpenXcom::RuleBaseFacility::getCrafts ( ) const

Gets the facility's craft capacity.

Gets the number of base craft this facility can contain.

Returns
The number of craft.
int OpenXcom::RuleBaseFacility::getDefenseValue ( ) const

Gets the facility's defense value.

Gets the defense value of this facility's weaponry against UFO invasions on the base.

Returns
The defense value.
int OpenXcom::RuleBaseFacility::getFireSound ( ) const

Gets the facility's fire sound.

Gets the fire sound of this facility's weaponry.

Returns
The sound index number.
int OpenXcom::RuleBaseFacility::getHitRatio ( ) const

Gets the facility's weapon hit ratio.

Gets the hit ratio of this facility's weaponry against UFO invasions on the base.

Returns
The hit ratio as a percentage.
int OpenXcom::RuleBaseFacility::getHitSound ( ) const

Gets the facility's hit sound.

Gets the hit sound of this facility's weaponry.

Returns
The sound index number.
int OpenXcom::RuleBaseFacility::getLaboratories ( ) const

Gets the facility's laboratory space.

Gets the amount of laboratory space this facility provides for research projects.

Returns
The laboratory space.
int OpenXcom::RuleBaseFacility::getListOrder ( ) const

Gets the facility's list weight.

Returns
The list weight for this research item.
std::string OpenXcom::RuleBaseFacility::getMapName ( ) const

Gets the facility's battlescape map name.

Gets the battlescape map block name for this facility to construct the base defense mission map.

Returns
The map name.
int OpenXcom::RuleBaseFacility::getMonthlyCost ( ) const

Gets the facility's monthly cost.

Gets the amount of funds this facility costs monthly to maintain once it's fully built.

Returns
The monthly cost.
int OpenXcom::RuleBaseFacility::getPersonnel ( ) const

Gets the facility's personnel capacity.

Gets the number of base personnel (soldiers, scientists, engineers) this facility can contain.

Returns
The number of personnel.
int OpenXcom::RuleBaseFacility::getPsiLaboratories ( ) const

Gets the facility's psi-training capacity.

Gets the number of soldiers this facility can contain for monthly psi-training.

Returns
The number of soldiers.
int OpenXcom::RuleBaseFacility::getRadarChance ( ) const

Gets the facility's detection chance.

Gets the chance of UFOs that come within the facility's radar range being detected.

Returns
The chance as a percentage.
int OpenXcom::RuleBaseFacility::getRadarRange ( ) const

Gets the facility's radar range.

Gets the radar range this facility provides for the detection of UFOs.

Returns
The range in nautical miles.
const std::vector< std::string > & OpenXcom::RuleBaseFacility::getRequirements ( ) const

Gets the facility's requirements.

Gets the list of research required to build this base facility.

Returns
A list of research IDs.
int OpenXcom::RuleBaseFacility::getSize ( ) const

Gets the facility's size.

Gets the size of the facility on the base grid.

Returns
The length in grid squares.
int OpenXcom::RuleBaseFacility::getSpriteFacility ( ) const

Gets the facility's content sprite.

Gets the ID of the sprite used to draw the facility's contents inside the base shape.

Returns
The sprite ID.
int OpenXcom::RuleBaseFacility::getSpriteShape ( ) const

Gets the facility's shape sprite.

Gets the ID of the sprite used to draw the base structure of the facility that defines its shape.

Returns
The sprite ID.
int OpenXcom::RuleBaseFacility::getStorage ( ) const

Gets the facility's storage capacity.

Gets the amount of storage space this facility provides for base equipment.

Returns
The storage space.
std::string OpenXcom::RuleBaseFacility::getType ( ) const

Gets the facility's type.

Gets the language string that names this base facility.

Each base facility type has a unique name.

Returns
The facility's name.
int OpenXcom::RuleBaseFacility::getWorkshops ( ) const

Gets the facility's workshop space.

Gets the amount of workshop space this facility provides for manufacturing projects.

Returns
The workshop space.
bool OpenXcom::RuleBaseFacility::isGravShield ( ) const

Gets if the facility is a grav shield.

Checks if this facility has a grav shield, which doubles base defense's fire ratio.

Returns
True if it has a grav shield.
bool OpenXcom::RuleBaseFacility::isHyperwave ( ) const

Gets if the facility has hyperwave detection.

Checks if this facility has hyperwave detection capabilities.

This allows it to get extra details about UFOs.

Returns
True if it has hyperwave detection.
bool OpenXcom::RuleBaseFacility::isLift ( ) const

Gets if the facility is an access lift.

Checks if this facility is the core access lift of a base.

Every base has an access lift and all facilities have to be connected to it.

Returns
True if it's a lift.
bool OpenXcom::RuleBaseFacility::isMindShield ( ) const

Gets if the facility is a mind shield.

Checks if this facility has a mind shield, which covers your base from alien detection.

Returns
True if it has a mind shield.
void OpenXcom::RuleBaseFacility::load ( const YAML::Node &  node,
int  modIndex,
int  listOrder 
)

Loads the facility from YAML.

Loads the base facility type from a YAML file.

Parameters
nodeYAML node.
modIndexA value that offsets the sounds and sprite values to avoid conflicts.
listOrderThe list weight for this facility.

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