* 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). */
| 47 | * @param id ID to assign to the craft (0 to not assign). |
| 48 | */ |
| 49 | Craft::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. |
nothing calls this directly
no test coverage detected