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

Represents a specific type of craft. More...

#include <RuleCraft.h>

Public Member Functions

 RuleCraft (const std::string &type)
 Creates a blank craft ruleset. More...
 
 ~RuleCraft ()
 Cleans up the craft ruleset.
 
void load (const YAML::Node &node, Ruleset *ruleset, int modIndex, int nextCraftIndex)
 Loads craft data from YAML. More...
 
std::string getType () const
 Gets the craft's type. More...
 
const std::vector< std::string > & getRequirements () const
 Gets the craft's requirements. More...
 
int getSprite () const
 Gets the craft's sprite. More...
 
int getMaxFuel () const
 Gets the craft's maximum fuel. More...
 
int getMaxDamage () const
 Gets the craft's maximum damage. More...
 
int getMaxSpeed () const
 Gets the craft's maximum speed. More...
 
int getAcceleration () const
 Gets the craft's acceleration. More...
 
int getWeapons () const
 Gets the craft's weapon capacity. More...
 
int getSoldiers () const
 Gets the craft's soldier capacity. More...
 
int getVehicles () const
 Gets the craft's vehicle capacity. More...
 
int getBuyCost () const
 Gets the craft's cost. More...
 
int getRentCost () const
 Gets the craft's rent for a month. More...
 
int getSellCost () const
 Gets the craft's value. More...
 
std::string getRefuelItem () const
 Gets the craft's refuel item. More...
 
int getRepairRate () const
 Gets the craft's repair rate. More...
 
int getRefuelRate () const
 Gets the craft's refuel rate. More...
 
int getRadarRange () const
 Gets the craft's radar range. More...
 
int getTransferTime () const
 Gets the craft's transfer time. More...
 
int getScore () const
 Gets the craft's score. More...
 
RuleTerraingetBattlescapeTerrainData ()
 Gets the craft's terrain data. More...
 
bool getSpacecraft () const
 Checks if this craft is capable of travelling to mars. More...
 
int getListOrder () const
 Gets the list weight for this craft. More...
 
std::vector< std::vector< int > > & getDeployment ()
 Gets the deployment priority for the craft. More...
 

Detailed Description

Represents a specific type of craft.

Contains constant info about a craft like costs, speed, capacities, consumptions, etc.

See also
Craft

Constructor & Destructor Documentation

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

Creates a blank craft ruleset.

Creates a blank ruleset for a certain type of craft.

Parameters
typeString defining the type.

Member Function Documentation

int OpenXcom::RuleCraft::getAcceleration ( ) const

Gets the craft's acceleration.

Gets the acceleration of the craft for taking off / stopping.

Returns
The acceleration.
RuleTerrain * OpenXcom::RuleCraft::getBattlescapeTerrainData ( )

Gets the craft's terrain data.

Gets the terrain data needed to draw the Craft in the battlescape.

Returns
The terrain data.
int OpenXcom::RuleCraft::getBuyCost ( ) const

Gets the craft's cost.

Gets the cost of this craft for purchase/rent (0 if not purchasable).

Returns
The cost.
std::vector< std::vector< int > > & OpenXcom::RuleCraft::getDeployment ( )

Gets the deployment priority for the craft.

Gets the deployment layout for this craft.

Returns
The deployment layout.
int OpenXcom::RuleCraft::getListOrder ( ) const

Gets the list weight for this craft.

Gets the list weight for this research item.

Returns
The list weight.
int OpenXcom::RuleCraft::getMaxDamage ( ) const

Gets the craft's maximum damage.

Gets the maximum damage (damage the craft can take) of the craft.

Returns
The maximum damage.
int OpenXcom::RuleCraft::getMaxFuel ( ) const

Gets the craft's maximum fuel.

Gets the maximum fuel the craft can contain.

Returns
The fuel amount.
int OpenXcom::RuleCraft::getMaxSpeed ( ) const

Gets the craft's maximum speed.

Gets the maximum speed of the craft flying around the Geoscape.

Returns
The speed in knots.
int OpenXcom::RuleCraft::getRadarRange ( ) const

Gets the craft's radar range.

Gets the craft's radar range for detecting UFOs.

Returns
The range in nautical miles.
std::string OpenXcom::RuleCraft::getRefuelItem ( ) const

Gets the craft's refuel item.

Gets what item is required while the craft is refuelling.

Returns
The item ID or "" if none.
int OpenXcom::RuleCraft::getRefuelRate ( ) const

Gets the craft's refuel rate.

Gets how much fuel is added to the craft while refuelling.

Returns
The amount of fuel.
int OpenXcom::RuleCraft::getRentCost ( ) const

Gets the craft's rent for a month.

Gets the cost of rent for a month.

Returns
The cost.
int OpenXcom::RuleCraft::getRepairRate ( ) const

Gets the craft's repair rate.

Gets how much damage is removed from the craft while repairing.

Returns
The amount of damage.
const std::vector< std::string > & OpenXcom::RuleCraft::getRequirements ( ) const

Gets the craft's requirements.

Gets the list of research required to acquire this craft.

Returns
The list of research IDs.
int OpenXcom::RuleCraft::getScore ( ) const

Gets the craft's score.

Gets the number of points you lose when this craft is destroyed.

Returns
The score in points.
int OpenXcom::RuleCraft::getSellCost ( ) const

Gets the craft's value.

Gets the sell value of this craft Rented craft should use 0.

Returns
The sell value.
int OpenXcom::RuleCraft::getSoldiers ( ) const

Gets the craft's soldier capacity.

Gets the maximum number of soldiers that the craft can carry.

Returns
The soldier capacity.
bool OpenXcom::RuleCraft::getSpacecraft ( ) const

Checks if this craft is capable of travelling to mars.

Checks if this ship is capable of going to mars.

Returns
True if this ship is capable of going to mars.
int OpenXcom::RuleCraft::getSprite ( ) const

Gets the craft's sprite.

Gets the ID of the sprite used to draw the craft in the Basescape and Equip Craft screens.

Returns
The Sprite ID.
int OpenXcom::RuleCraft::getTransferTime ( ) const

Gets the craft's transfer time.

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

Returns
The time in hours.
std::string OpenXcom::RuleCraft::getType ( ) const

Gets the craft's type.

Gets the language string that names this craft.

Each craft type has a unique name.

Returns
The craft's name.
int OpenXcom::RuleCraft::getVehicles ( ) const

Gets the craft's vehicle capacity.

Gets the maximum number of vehicles that the craft can carry.

Returns
The vehicle capacity.
int OpenXcom::RuleCraft::getWeapons ( ) const

Gets the craft's weapon capacity.

Gets the maximum number of weapons that can be equipped onto the craft.

Returns
The weapon capacity.
void OpenXcom::RuleCraft::load ( const YAML::Node &  node,
Ruleset ruleset,
int  modIndex,
int  listOrder 
)

Loads craft data from YAML.

Loads the craft from a YAML file.

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

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