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

Represents an item transfer. More...

#include <Transfer.h>

Public Member Functions

 Transfer (int hours)
 Creates a new transfer. More...
 
 ~Transfer ()
 Cleans up the transfer. More...
 
bool load (const YAML::Node &node, Base *base, const Ruleset *rule, SavedGame *save)
 Loads the transfer from YAML. More...
 
YAML::Node save () const
 Saves the transfer to YAML. More...
 
void setSoldier (Soldier *soldier)
 Sets the soldier of the transfer. More...
 
void setCraft (Craft *craft)
 Sets the craft of the transfer. More...
 
CraftgetCraft ()
 Gets the craft of the transfer. More...
 
std::string getItems () const
 Gets the items of the transfer. More...
 
void setItems (const std::string &id, int qty=1)
 Sets the items of the transfer. More...
 
void setScientists (int scientists)
 Sets the scientists of the transfer. More...
 
void setEngineers (int engineers)
 Sets the engineers of the transfer. More...
 
std::wstring getName (Language *lang) const
 Gets the name of the transfer. More...
 
int getHours () const
 Gets the hours remaining of the transfer. More...
 
int getQuantity () const
 Gets the quantity of the transfer. More...
 
TransferType getType () const
 Gets the type of the transfer. More...
 
void advance (Base *base)
 Advances the transfer. More...
 
SoldiergetSoldier ()
 Get a pointer to the soldier being transferred. More...
 

Detailed Description

Represents an item transfer.

Items are placed "in transit" whenever they are purchased or transferred between bases.

Constructor & Destructor Documentation

OpenXcom::Transfer::Transfer ( int  hours)

Creates a new transfer.

Initializes a transfer.

Parameters
hoursHours in-transit.
OpenXcom::Transfer::~Transfer ( )

Cleans up the transfer.

Cleans up undelivered transfers.

Member Function Documentation

void OpenXcom::Transfer::advance ( Base base)

Advances the transfer.

Advances the transfer and takes care of the delivery once it's arrived.

Parameters
basePointer to destination base.
Craft * OpenXcom::Transfer::getCraft ( )

Gets the craft of the transfer.

Gets the craft being transferred.

Returns
a Pointer to craft.
int OpenXcom::Transfer::getHours ( ) const

Gets the hours remaining of the transfer.

Returns the time remaining until the transfer arrives at its destination.

Returns
Amount of hours.
std::string OpenXcom::Transfer::getItems ( ) const

Gets the items of the transfer.

Returns the items being transferred.

Returns
Item ID.
std::wstring OpenXcom::Transfer::getName ( Language lang) const

Gets the name of the transfer.

Returns the name of the contents of the transfer.

Parameters
langLanguage to get strings from.
Returns
Name string.
int OpenXcom::Transfer::getQuantity ( ) const

Gets the quantity of the transfer.

Returns the quantity of items in the transfer.

Returns
Amount of items.
Soldier * OpenXcom::Transfer::getSoldier ( )

Get a pointer to the soldier being transferred.

Returns
a pointer to the soldier being moved.
TransferType OpenXcom::Transfer::getType ( ) const

Gets the type of the transfer.

Returns the type of the contents of the transfer.

Returns
TransferType.
bool OpenXcom::Transfer::load ( const YAML::Node &  node,
Base base,
const Ruleset rule,
SavedGame save 
)

Loads the transfer from YAML.

Loads the transfer from a YAML file.

Parameters
nodeYAML node.
baseDestination base.
ruleGame ruleset.
savePointer to savegame.
Returns
Was the transfer content valid?
YAML::Node OpenXcom::Transfer::save ( ) const

Saves the transfer to YAML.

Saves the transfer to a YAML file.

Returns
YAML node.
void OpenXcom::Transfer::setCraft ( Craft craft)

Sets the craft of the transfer.

Changes the craft being transferred.

Parameters
craftPointer to craft.
void OpenXcom::Transfer::setEngineers ( int  engineers)

Sets the engineers of the transfer.

Changes the engineers being transferred.

Parameters
engineersAmount of engineers.
void OpenXcom::Transfer::setItems ( const std::string &  id,
int  qty = 1 
)

Sets the items of the transfer.

Changes the items being transferred.

Parameters
idItem identifier.
qtyItem quantity.
void OpenXcom::Transfer::setScientists ( int  scientists)

Sets the scientists of the transfer.

Changes the scientists being transferred.

Parameters
scientistsAmount of scientists.
void OpenXcom::Transfer::setSoldier ( Soldier soldier)

Sets the soldier of the transfer.

Changes the soldier being transferred.

Parameters
soldierPointer to soldier.

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