OpenXcom
1.0
Open-source clone of the original X-Com
|
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... | |
Craft * | getCraft () |
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... | |
Soldier * | getSoldier () |
Get a pointer to the soldier being transferred. More... | |
Represents an item transfer.
Items are placed "in transit" whenever they are purchased or transferred between bases.
OpenXcom::Transfer::Transfer | ( | int | hours | ) |
Creates a new transfer.
Initializes a transfer.
hours | Hours in-transit. |
OpenXcom::Transfer::~Transfer | ( | ) |
Cleans up the transfer.
Cleans up undelivered transfers.
void OpenXcom::Transfer::advance | ( | Base * | base | ) |
Advances the transfer.
Advances the transfer and takes care of the delivery once it's arrived.
base | Pointer to destination base. |
Craft * OpenXcom::Transfer::getCraft | ( | ) |
Gets the craft of the transfer.
Gets the craft being transferred.
int OpenXcom::Transfer::getHours | ( | ) | const |
Gets the hours remaining of the transfer.
Returns the time remaining until the transfer arrives at its destination.
std::string OpenXcom::Transfer::getItems | ( | ) | const |
Gets the items of the transfer.
Returns the items being transferred.
std::wstring OpenXcom::Transfer::getName | ( | Language * | lang | ) | const |
Gets the name of the transfer.
Returns the name of the contents of the transfer.
lang | Language to get strings from. |
int OpenXcom::Transfer::getQuantity | ( | ) | const |
Gets the quantity of the transfer.
Returns the quantity of items in the transfer.
Soldier * OpenXcom::Transfer::getSoldier | ( | ) |
Get a pointer to the soldier being transferred.
TransferType OpenXcom::Transfer::getType | ( | ) | const |
Gets the type of the transfer.
Returns the type of the contents of the transfer.
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.
node | YAML node. |
base | Destination base. |
rule | Game ruleset. |
save | Pointer to savegame. |
YAML::Node OpenXcom::Transfer::save | ( | ) | const |
Saves the transfer to YAML.
Saves the transfer to a YAML file.
void OpenXcom::Transfer::setCraft | ( | Craft * | craft | ) |
Sets the craft of the transfer.
Changes the craft being transferred.
craft | Pointer to craft. |
void OpenXcom::Transfer::setEngineers | ( | int | engineers | ) |
Sets the engineers of the transfer.
Changes the engineers being transferred.
engineers | Amount of engineers. |
void OpenXcom::Transfer::setItems | ( | const std::string & | id, |
int | qty = 1 |
||
) |
Sets the items of the transfer.
Changes the items being transferred.
id | Item identifier. |
qty | Item quantity. |
void OpenXcom::Transfer::setScientists | ( | int | scientists | ) |
Sets the scientists of the transfer.
Changes the scientists being transferred.
scientists | Amount of scientists. |
void OpenXcom::Transfer::setSoldier | ( | Soldier * | soldier | ) |
Sets the soldier of the transfer.
Changes the soldier being transferred.
soldier | Pointer to soldier. |