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

Represents a soldier-equipment layout item which is used on the beginning of the Battlescape. More...

#include <EquipmentLayoutItem.h>

Public Member Functions

 EquipmentLayoutItem (const YAML::Node &node)
 Creates a new soldier-equipment layout item and loads its contents from YAML. More...
 
 EquipmentLayoutItem (std::string itemType, std::string slot, int slotX, int slotY, std::string ammoItem, int fuseTimer)
 Creates a new soldier-equipment layout item. More...
 
 ~EquipmentLayoutItem ()
 Cleans up the soldier-equipment layout item.
 
std::string getItemType () const
 Gets the item's type which has to be in a slot. More...
 
std::string getSlot () const
 Gets the slot to be occupied. More...
 
int getSlotX () const
 Gets the slotX to be occupied. More...
 
int getSlotY () const
 Gets the slotY to be occupied. More...
 
std::string getAmmoItem () const
 Gets the ammo item. More...
 
int getFuseTimer () const
 Gets the turn until explosion. More...
 
void load (const YAML::Node &node)
 Loads the soldier-equipment layout item from YAML. More...
 
YAML::Node save () const
 Saves the soldier-equipment layout item to YAML. More...
 

Detailed Description

Represents a soldier-equipment layout item which is used on the beginning of the Battlescape.

Constructor & Destructor Documentation

OpenXcom::EquipmentLayoutItem::EquipmentLayoutItem ( const YAML::Node &  node)

Creates a new soldier-equipment layout item and loads its contents from YAML.

Initializes a new soldier-equipment layout item from YAML.

Parameters
nodeYAML node.
OpenXcom::EquipmentLayoutItem::EquipmentLayoutItem ( std::string  itemType,
std::string  slot,
int  slotX,
int  slotY,
std::string  ammoItem,
int  fuseTimer 
)

Creates a new soldier-equipment layout item.

Initializes a new soldier-equipment layout item.

Parameters
itemTypeItem's type.
slotOccupied slot's id.
slotXPosition-X in the occupied slot.
slotYPosition-Y in the occupied slot.
ammoItemThe ammo has to be loaded into the item. (it's type)
fuseTimerThe turn until explosion of the item. (if it's an activated grenade-type)

Member Function Documentation

std::string OpenXcom::EquipmentLayoutItem::getAmmoItem ( ) const

Gets the ammo item.

Returns the ammo has to be loaded into the item.

Returns
ammo type.
int OpenXcom::EquipmentLayoutItem::getFuseTimer ( ) const

Gets the turn until explosion.

Returns the turn until explosion of the item.

(if it's an activated grenade-type)

Returns
turn count.
std::string OpenXcom::EquipmentLayoutItem::getItemType ( ) const

Gets the item's type which has to be in a slot.

Returns the item's type which has to be in a slot.

Returns
item type.
std::string OpenXcom::EquipmentLayoutItem::getSlot ( ) const

Gets the slot to be occupied.

Returns the slot to be occupied.

Returns
slot name.
int OpenXcom::EquipmentLayoutItem::getSlotX ( ) const

Gets the slotX to be occupied.

Returns the position-X in the slot to be occupied.

Returns
slot-X.
int OpenXcom::EquipmentLayoutItem::getSlotY ( ) const

Gets the slotY to be occupied.

Returns the position-Y in the slot to be occupied.

Returns
slot-Y.
void OpenXcom::EquipmentLayoutItem::load ( const YAML::Node &  node)

Loads the soldier-equipment layout item from YAML.

Loads the soldier-equipment layout item from a YAML file.

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

Saves the soldier-equipment layout item to YAML.

Saves the soldier-equipment layout item to a YAML file.

Returns
YAML node.

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