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

Represents a specific type of UFO. More...

#include <RuleUfo.h>

Public Member Functions

 RuleUfo (const std::string &type)
 Creates a blank UFO ruleset. More...
 
 ~RuleUfo ()
 Cleans up the UFO ruleset.
 
void load (const YAML::Node &node, Ruleset *ruleset)
 Loads UFO data from YAML. More...
 
std::string getType () const
 Gets the UFO's type. More...
 
std::string getSize () const
 Gets the UFO's size. More...
 
int getRadius () const
 Gets the UFO's radius. More...
 
int getSprite () const
 Gets the UFO's sprite. More...
 
int getMaxDamage () const
 Gets the UFO's maximum damage. More...
 
int getMaxSpeed () const
 Gets the UFO's maximum speed. More...
 
int getAcceleration () const
 Gets the UFO's acceleration. More...
 
int getWeaponPower () const
 Gets the UFO's weapon power. More...
 
int getWeaponRange () const
 Gets the UFO's weapon range. More...
 
int getScore () const
 Gets the UFO's score. More...
 
RuleTerraingetBattlescapeTerrainData ()
 Sets the battlescape terrain data ruleset for this UFO. More...
 
int getWeaponReload () const
 Gets the reload time of the UFO's weapon. More...
 
int getBreakOffTime () const
 Gets the UFO's escape time. More...
 
std::string getModSprite () const
 Gets the name of the surface that represents this UFO. More...
 

Detailed Description

Represents a specific type of UFO.

Contains constant info about a UFO like speed, weapons, scores, etc.

See also
Ufo

Constructor & Destructor Documentation

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

Creates a blank UFO ruleset.

Creates a blank ruleset for a certain type of UFO.

Parameters
typeString defining the type.

Member Function Documentation

int OpenXcom::RuleUfo::getAcceleration ( ) const

Gets the UFO's acceleration.

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

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

Sets the battlescape terrain data ruleset for this UFO.

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

Returns
The RuleTerrain.
int OpenXcom::RuleUfo::getBreakOffTime ( ) const

Gets the UFO's escape time.

Gets the UFO's break off time.

Returns
The UFO's break off time in game seconds.
int OpenXcom::RuleUfo::getMaxDamage ( ) const

Gets the UFO's maximum damage.

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

Returns
The maximum damage.
int OpenXcom::RuleUfo::getMaxSpeed ( ) const

Gets the UFO's maximum speed.

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

Returns
The maximum speed.
std::string OpenXcom::RuleUfo::getModSprite ( ) const

Gets the name of the surface that represents this UFO.

For user-defined UFOs, use a surface for the "preview" image.

Returns
The name of the surface that represents this UFO.
int OpenXcom::RuleUfo::getRadius ( ) const

Gets the UFO's radius.

Gets the radius of this type of UFO on the dogfighting window.

Returns
The radius in pixels.
int OpenXcom::RuleUfo::getScore ( ) const

Gets the UFO's score.

Gets the amount of points the player gets for shooting down the UFO.

Returns
The score.
std::string OpenXcom::RuleUfo::getSize ( ) const

Gets the UFO's size.

Gets the size of this type of UFO.

Returns
The Ufo's size.
int OpenXcom::RuleUfo::getSprite ( ) const

Gets the UFO's sprite.

Gets the ID of the sprite used to draw the UFO in the Dogfight window.

Returns
The sprite ID.
std::string OpenXcom::RuleUfo::getType ( ) const

Gets the UFO's type.

Gets the language string that names this UFO.

Each UFO type has a unique name.

Returns
The Ufo's name.
int OpenXcom::RuleUfo::getWeaponPower ( ) const

Gets the UFO's weapon power.

Gets the maximum damage done by the UFO's weapons per shot.

Returns
The weapon power.
int OpenXcom::RuleUfo::getWeaponRange ( ) const

Gets the UFO's weapon range.

Gets the maximum range for the UFO's weapons.

Returns
The weapon range.
int OpenXcom::RuleUfo::getWeaponReload ( ) const

Gets the reload time of the UFO's weapon.

Gets the weapon reload for UFO ships.

Returns
The UFO weapon reload time.
void OpenXcom::RuleUfo::load ( const YAML::Node &  node,
Ruleset ruleset 
)

Loads UFO data from YAML.

Loads the UFO from a YAML file.

Parameters
nodeYAML node.
rulesetRuleset for the UFO.

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