19 #ifndef OPENXCOM_CRAFT_H
20 #define OPENXCOM_CRAFT_H
22 #include "MovingTarget.h"
49 int _id, _fuel, _damage, _interceptionOrder, _takeoff;
50 std::vector<CraftWeapon*> _weapons;
52 std::vector<Vehicle*> _vehicles;
54 bool _lowFuel, _inBattlescape, _inDogfight;
64 YAML::Node
save()
const;
76 void setName(
const std::wstring &newName);
86 void setStatus(
const std::string &status);
std::vector< CraftWeapon * > * getWeapons()
Gets the craft's weapons.
Definition: Craft.cpp:462
Represents a craft stored in a base.
Definition: Craft.h:44
bool getLowFuel() const
Gets whether the craft is running out of fuel.
Definition: Craft.cpp:562
std::vector< Vehicle * > * getVehicles()
Gets the craft's vehicles.
Definition: Craft.cpp:481
std::string getStatus() const
Gets the craft's status.
Definition: Craft.cpp:343
void setInDogfight(const bool inDogfight)
Sets the craft's dogfight status.
Definition: Craft.cpp:881
void setInBattlescape(bool inbattle)
Sets the craft's battlescape status.
Definition: Craft.cpp:805
ItemContainer * getItems()
Gets the craft's items.
Definition: Craft.cpp:471
std::string getAltitude() const
Gets the craft's altitude.
Definition: Craft.cpp:361
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:80
int getFuelLimit() const
Gets the craft's minimum fuel limit.
Definition: Craft.cpp:604
int getNumEquipment() const
Gets the craft's amount of equipment.
Definition: Craft.cpp:442
void refuel()
Refuels the craft.
Definition: Craft.cpp:728
Craft(RuleCraft *rules, Base *base, int id=0)
Creates a craft of the specified type.
Definition: Craft.cpp:49
void setBase(Base *base)
Sets the craft's base.
Definition: Craft.cpp:323
Base * getBase() const
Gets the craft's base.
Definition: Craft.cpp:314
void consumeFuel()
Consumes the craft's fuel.
Definition: Craft.cpp:706
~Craft()
Cleans up the craft.
Definition: Craft.cpp:66
int getId() const
Gets the craft's ID.
Definition: Craft.cpp:284
Contains strings used throughout the game for localization.
Definition: Language.h:42
int getFuelPercentage() const
Gets the craft's percentage of fuel.
Definition: Craft.cpp:519
void load(const YAML::Node &node, const Ruleset *rule, SavedGame *save)
Loads the craft from YAML.
Definition: Craft.cpp:85
Set of rules and stats for a game.
Definition: Ruleset.h:69
int getDamage() const
Gets the craft's amount of damage.
Definition: Craft.cpp:528
int getNumSoldiers() const
Gets the craft's amount of soldiers.
Definition: Craft.cpp:421
void setFuel(int fuel)
Sets the craft's amount of fuel.
Definition: Craft.cpp:501
void setStatus(const std::string &status)
Sets the craft's status.
Definition: Craft.cpp:352
int getDamagePercentage() const
Gets the craft's percentage of damage.
Definition: Craft.cpp:552
void repair()
Repairs the craft.
Definition: Craft.cpp:715
YAML::Node save() const
Saves the craft to YAML.
Definition: Craft.cpp:205
Represents the items contained by a certain entity, like base stores, craft equipment, etc.
Definition: ItemContainer.h:36
Represents a player base on the globe.
Definition: Base.h:47
int getVehicleCount(const std::string &vehicle) const
Gets the craft's vehicles of a certain type.
Definition: Craft.cpp:855
bool isInBattlescape() const
Gets if the craft is in battlescape.
Definition: Craft.cpp:796
Represents a specific type of craft.
Definition: RuleCraft.h:38
RuleCraft * getRules() const
Gets the craft's ruleset.
Definition: Craft.cpp:259
void setDestination(Target *dest)
Sets the craft's destination.
Definition: Craft.cpp:378
void setDamage(int damage)
Sets the craft's amount of damage.
Definition: Craft.cpp:537
int getSpaceAvailable() const
Gets the amount of space available inside a craft.
Definition: Craft.cpp:829
int getFuelConsumption() const
Gets the craft's fuel consumption.
Definition: Craft.cpp:592
void setBaseOnly(Base *base)
Sets the craft's base. (without setting the craft's coordinates)
Definition: Craft.cpp:334
void returnToBase()
Returns the craft to its base.
Definition: Craft.cpp:623
YAML::Node saveId() const
Saves the craft's ID to YAML.
Definition: Craft.cpp:247
int getInterceptionOrder() const
Gets interception number.
Definition: Craft.cpp:899
bool isInDogfight() const
Gets if the craft is in dogfight.
Definition: Craft.cpp:872
double getDistanceFromBase() const
Gets the craft's distance from its base.
Definition: Craft.cpp:582
std::wstring getName(Language *lang) const
Gets the craft's name.
Definition: Craft.cpp:295
bool detect(Target *target) const
Checks if a target is detected by the craft's radar.
Definition: Craft.cpp:694
void think()
Handles craft logic.
Definition: Craft.cpp:631
Base class for moving targets on the globe with a certain speed and destination.
Definition: MovingTarget.h:31
void setLowFuel(bool low)
Sets whether the craft is running out of fuel.
Definition: Craft.cpp:572
void checkup()
Does a craft full checkup.
Definition: Craft.cpp:656
int getSpaceUsed() const
Gets the amount of space used inside a craft.
Definition: Craft.cpp:839
int getNumVehicles() const
Gets the craft's amount of vehicles.
Definition: Craft.cpp:452
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
int getFuel() const
Gets the craft's amount of fuel.
Definition: Craft.cpp:491
std::string rearm(Ruleset *rules)
Rearms the craft.
Definition: Craft.cpp:751
void setInterceptionOrder(const int order)
Sets interception order (first craft to leave the base gets 1, second 2, etc.).
Definition: Craft.cpp:890
void setRules(RuleCraft *rules)
Sets the craft's ruleset.
Definition: Craft.cpp:269
void setName(const std::wstring &newName)
Sets the craft's name.
Definition: Craft.cpp:305
int getNumWeapons() const
Gets the craft's amount of weapons.
Definition: Craft.cpp:396
bool isDestroyed() const
Gets if craft is destroyed during dogfights.
Definition: Craft.cpp:819