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:463
Represents a craft stored in a base.
Definition: Craft.h:44
int getDamagePercentage() const
Gets the craft's percentage of damage.
Definition: Craft.cpp:553
int getFuelLimit() const
Gets the craft's minimum fuel limit.
Definition: Craft.cpp:605
int getNumEquipment() const
Gets the craft's amount of equipment.
Definition: Craft.cpp:443
bool detect(Target *target) const
Checks if a target is detected by the craft's radar.
Definition: Craft.cpp:695
YAML::Node save() const
Saves the craft to YAML.
Definition: Craft.cpp:206
std::vector< Vehicle * > * getVehicles()
Gets the craft's vehicles.
Definition: Craft.cpp:482
void setInDogfight(const bool inDogfight)
Sets the craft's dogfight status.
Definition: Craft.cpp:882
void setInBattlescape(bool inbattle)
Sets the craft's battlescape status.
Definition: Craft.cpp:806
int getSpaceAvailable() const
Gets the amount of space available inside a craft.
Definition: Craft.cpp:830
ItemContainer * getItems()
Gets the craft's items.
Definition: Craft.cpp:472
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:80
bool isInBattlescape() const
Gets if the craft is in battlescape.
Definition: Craft.cpp:797
void refuel()
Refuels the craft.
Definition: Craft.cpp:729
Craft(RuleCraft *rules, Base *base, int id=0)
Creates a craft of the specified type.
Definition: Craft.cpp:50
void setBase(Base *base)
Sets the craft's base.
Definition: Craft.cpp:324
int getFuel() const
Gets the craft's amount of fuel.
Definition: Craft.cpp:492
int getNumSoldiers() const
Gets the craft's amount of soldiers.
Definition: Craft.cpp:422
void consumeFuel()
Consumes the craft's fuel.
Definition: Craft.cpp:707
~Craft()
Cleans up the craft.
Definition: Craft.cpp:67
int getId() const
Gets the craft's ID.
Definition: Craft.cpp:285
std::string getStatus() const
Gets the craft's status.
Definition: Craft.cpp:344
int getNumWeapons() const
Gets the craft's amount of weapons.
Definition: Craft.cpp:397
double getDistanceFromBase() const
Gets the craft's distance from its base.
Definition: Craft.cpp:583
Base * getBase() const
Gets the craft's base.
Definition: Craft.cpp:315
Contains strings used throughout the game for localization.
Definition: Language.h:42
int getDamage() const
Gets the craft's amount of damage.
Definition: Craft.cpp:529
void load(const YAML::Node &node, const Ruleset *rule, SavedGame *save)
Loads the craft from YAML.
Definition: Craft.cpp:86
Set of rules and stats for a game.
Definition: Ruleset.h:69
int getSpaceUsed() const
Gets the amount of space used inside a craft.
Definition: Craft.cpp:840
void setFuel(int fuel)
Sets the craft's amount of fuel.
Definition: Craft.cpp:502
std::wstring getName(Language *lang) const
Gets the craft's name.
Definition: Craft.cpp:296
void setStatus(const std::string &status)
Sets the craft's status.
Definition: Craft.cpp:353
void repair()
Repairs the craft.
Definition: Craft.cpp:716
std::string getAltitude() const
Gets the craft's altitude.
Definition: Craft.cpp:362
Represents the items contained by a certain entity, like base stores, craft equipment, etc.
Definition: ItemContainer.h:36
YAML::Node saveId() const
Saves the craft's ID to YAML.
Definition: Craft.cpp:248
bool getLowFuel() const
Gets whether the craft is running out of fuel.
Definition: Craft.cpp:563
int getInterceptionOrder() const
Gets interception number.
Definition: Craft.cpp:900
Represents a player base on the globe.
Definition: Base.h:47
Represents a specific type of craft.
Definition: RuleCraft.h:38
void setDestination(Target *dest)
Sets the craft's destination.
Definition: Craft.cpp:379
void setDamage(int damage)
Sets the craft's amount of damage.
Definition: Craft.cpp:538
void setBaseOnly(Base *base)
Sets the craft's base. (without setting the craft's coordinates)
Definition: Craft.cpp:335
void returnToBase()
Returns the craft to its base.
Definition: Craft.cpp:624
bool isInDogfight() const
Gets if the craft is in dogfight.
Definition: Craft.cpp:873
bool isDestroyed() const
Gets if craft is destroyed during dogfights.
Definition: Craft.cpp:820
void think()
Handles craft logic.
Definition: Craft.cpp:632
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:573
void checkup()
Does a craft full checkup.
Definition: Craft.cpp:657
int getFuelConsumption() const
Gets the craft's fuel consumption.
Definition: Craft.cpp:593
int getVehicleCount(const std::string &vehicle) const
Gets the craft's vehicles of a certain type.
Definition: Craft.cpp:856
RuleCraft * getRules() const
Gets the craft's ruleset.
Definition: Craft.cpp:260
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
std::string rearm(Ruleset *rules)
Rearms the craft.
Definition: Craft.cpp:752
int getNumVehicles() const
Gets the craft's amount of vehicles.
Definition: Craft.cpp:453
COPYING:
Definition: BaseInfoState.cpp:41
void setInterceptionOrder(const int order)
Sets interception order (first craft to leave the base gets 1, second 2, etc.).
Definition: Craft.cpp:891
int getFuelPercentage() const
Gets the craft's percentage of fuel.
Definition: Craft.cpp:520
void setRules(RuleCraft *rules)
Sets the craft's ruleset.
Definition: Craft.cpp:270
void setName(const std::wstring &newName)
Sets the craft's name.
Definition: Craft.cpp:306