OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a craft weapon equipped by a craft. More...
#include <CraftWeapon.h>
Public Member Functions | |
CraftWeapon (RuleCraftWeapon *rules, int ammo) | |
Creates a craft weapon of the specified type. More... | |
~CraftWeapon () | |
Cleans up the craft weapon. | |
void | load (const YAML::Node &node) |
Loads the craft weapon from YAML. More... | |
YAML::Node | save () const |
Saves the craft weapon to YAML. More... | |
RuleCraftWeapon * | getRules () const |
Gets the craft weapon's ruleset. More... | |
int | getAmmo () const |
Gets the craft weapon's ammo. More... | |
bool | setAmmo (int ammo) |
Sets the craft weapon's ammo. More... | |
bool | isRearming () const |
Gets the craft weapon's rearming status. More... | |
void | setRearming (bool rearming) |
Sets the craft weapon's rearming status. More... | |
int | rearm (const int available, const int clipSize) |
Rearms the craft weapon. More... | |
CraftWeaponProjectile * | fire () const |
Fires the craft weapon. Used during dogfights. | |
int | getClipsLoaded (Ruleset *ruleset) |
get how many clips are loaded into this weapon. | |
Represents a craft weapon equipped by a craft.
Contains variable info about a craft weapon like ammo.
OpenXcom::CraftWeapon::CraftWeapon | ( | RuleCraftWeapon * | rules, |
int | ammo | ||
) |
Creates a craft weapon of the specified type.
Initializes a craft weapon of the specified type.
rules | Pointer to ruleset. |
ammo | Initial ammo. |
int OpenXcom::CraftWeapon::getAmmo | ( | ) | const |
Gets the craft weapon's ammo.
Returns the ammo contained in this craft weapon.
RuleCraftWeapon * OpenXcom::CraftWeapon::getRules | ( | ) | const |
Gets the craft weapon's ruleset.
Returns the ruleset for the craft weapon's type.
bool OpenXcom::CraftWeapon::isRearming | ( | ) | const |
Gets the craft weapon's rearming status.
Returns whether this craft weapon needs rearming.
void OpenXcom::CraftWeapon::load | ( | const YAML::Node & | node | ) |
Loads the craft weapon from YAML.
Loads the craft weapon from a YAML file.
node | YAML node. |
int OpenXcom::CraftWeapon::rearm | ( | const int | available, |
const int | clipSize | ||
) |
Rearms the craft weapon.
Rearms this craft weapon's ammo.
available | number of clips available. |
clipSize | number of rounds in said clips. |
YAML::Node OpenXcom::CraftWeapon::save | ( | ) | const |
Saves the craft weapon to YAML.
Saves the base to a YAML file.
bool OpenXcom::CraftWeapon::setAmmo | ( | int | ammo | ) |
Sets the craft weapon's ammo.
Changes the ammo contained in this craft weapon.
ammo | Weapon ammo. |
void OpenXcom::CraftWeapon::setRearming | ( | bool | rearming | ) |
Sets the craft weapon's rearming status.
Changes whether this craft weapon needs rearming (for example, in case there's no more ammo).
rearming | Rearming status. |