MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / Craft

Method Craft

src/Savegame/Craft.cpp:49–61  ·  view source on GitHub ↗

* Initializes a craft of the specified type and * assigns it the latest craft ID available. * @param rules Pointer to ruleset. * @param base Pointer to base of origin. * @param id ID to assign to the craft (0 to not assign). */

Source from the content-addressed store, hash-verified

47 * @param id ID to assign to the craft (0 to not assign).
48 */
49Craft::Craft(RuleCraft *rules, Base *base, int id) : MovingTarget(), _rules(rules), _base(base), _id(0), _fuel(0), _damage(0), _interceptionOrder(0), _takeoff(0), _weapons(), _status("STR_READY"), _lowFuel(false), _inBattlescape(false), _inDogfight(false), _name(L"")
50{
51 _items = new ItemContainer();
52 if (id != 0)
53 {
54 _id = id;
55 }
56 for (int i = 0; i < _rules->getWeapons(); ++i)
57 {
58 _weapons.push_back(0);
59 }
60 setBase(base);
61}
62
63/**
64 * Delete the contents of the craft from memory.

Callers

nothing calls this directly

Calls 1

getWeaponsMethod · 0.45

Tested by

no test coverage detected