21 #include <yaml-cpp/yaml.h> 26 enum TransferType { TRANSFER_ITEM, TRANSFER_CRAFT, TRANSFER_SOLDIER, TRANSFER_SCIENTIST, TRANSFER_ENGINEER };
57 int _itemQty, _scientists, _engineers;
67 YAML::Node
save()
const;
77 void setItems(
const std::string &
id,
int qty = 1);
void advance(Base *base)
Advances the transfer.
Definition: Transfer.cpp:298
Represents a craft stored in a base.
Definition: Craft.h:45
int getHours() const
Gets the hours remaining of the transfer.
Definition: Transfer.cpp:242
Transfer(int hours)
Creates a new transfer.
Definition: Transfer.cpp:35
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:99
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
Represents an item transfer.
Definition: Transfer.h:50
void setItems(const std::string &id, int qty=1)
Sets the items of the transfer.
Definition: Transfer.cpp:187
std::string getItems() const
Gets the items of the transfer.
Definition: Transfer.cpp:177
Soldier * getSoldier()
Get a pointer to the soldier being transferred.
Definition: Transfer.cpp:333
~Transfer()
Cleans up the transfer.
Definition: Transfer.cpp:42
bool load(const YAML::Node &node, Base *base, const Mod *mod, SavedGame *save)
Loads the transfer from YAML.
Definition: Transfer.cpp:59
Contains strings used throughout the game for localization.
Definition: Language.h:39
Represents a soldier hired by the player.
Definition: Soldier.h:48
void setCraft(Craft *craft)
Sets the craft of the transfer.
Definition: Transfer.cpp:159
YAML::Node save() const
Saves the transfer to YAML.
Definition: Transfer.cpp:114
Represents a player base on the globe.
Definition: Base.h:45
Definition: Transfer.h:28
std::string getName(Language *lang) const
Gets the name of the transfer.
Definition: Transfer.cpp:216
int getQuantity() const
Gets the quantity of the transfer.
Definition: Transfer.cpp:251
void setScientists(int scientists)
Sets the scientists of the transfer.
Definition: Transfer.cpp:197
Craft * getCraft()
Gets the craft of the transfer.
Definition: Transfer.cpp:168
void setSoldier(Soldier *soldier)
Sets the soldier of the transfer.
Definition: Transfer.cpp:150
void setEngineers(int engineers)
Sets the engineers of the transfer.
Definition: Transfer.cpp:206
TransferType getType() const
Gets the type of the transfer.
Definition: Transfer.cpp:272
Definition: BaseInfoState.cpp:40