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

Represents a vehicle (tanks etc.) kept in a craft. More...

#include <Vehicle.h>

Public Member Functions

 Vehicle (RuleItem *rules, int ammo, int size)
 Creates a vehicle of the specified type. More...
 
 ~Vehicle ()
 Cleans up the vehicle.
 
void load (const YAML::Node &node)
 Loads the vehicle from YAML. More...
 
YAML::Node save () const
 Saves the vehicle to YAML. More...
 
RuleItemgetRules () const
 Gets the vehicle's ruleset. More...
 
int getAmmo () const
 Gets the vehicle's ammo. More...
 
void setAmmo (int ammo)
 Sets the vehicle's ammo. More...
 
int getSize () const
 Gets the vehicle's size. More...
 

Detailed Description

Represents a vehicle (tanks etc.) kept in a craft.

Contains variable info about a vehicle like ammo.

See also
RuleItem

Constructor & Destructor Documentation

OpenXcom::Vehicle::Vehicle ( RuleItem rules,
int  ammo,
int  size 
)

Creates a vehicle of the specified type.

Initializes a vehicle of the specified type.

Parameters
rulesPointer to ruleset.
ammoInitial ammo.
sizeSize in tiles.

Member Function Documentation

int OpenXcom::Vehicle::getAmmo ( ) const

Gets the vehicle's ammo.

Returns the ammo contained in this vehicle.

Returns
Weapon ammo.
RuleItem * OpenXcom::Vehicle::getRules ( ) const

Gets the vehicle's ruleset.

Returns the ruleset for the vehicle's type.

Returns
Pointer to ruleset.
int OpenXcom::Vehicle::getSize ( ) const

Gets the vehicle's size.

Returns the size occupied by this vehicle in a transport craft.

Returns
Size in tiles.
void OpenXcom::Vehicle::load ( const YAML::Node &  node)

Loads the vehicle from YAML.

Loads the vehicle from a YAML file.

Parameters
nodeYAML node.
YAML::Node OpenXcom::Vehicle::save ( ) const

Saves the vehicle to YAML.

Saves the base to a YAML file.

Returns
YAML node.
void OpenXcom::Vehicle::setAmmo ( int  ammo)

Sets the vehicle's ammo.

Changes the ammo contained in this vehicle.

Parameters
ammoWeapon ammo.

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