19 #ifndef OPENXCOM_UFO_H
20 #define OPENXCOM_UFO_H
22 #include "MovingTarget.h"
24 #include <yaml-cpp/yaml.h>
44 enum UfoStatus { FLYING, LANDED, CRASHED, DESTROYED };
47 int _id, _crashId, _landId, _damage;
48 std::string _direction, _altitude;
49 enum UfoStatus _status;
50 size_t _secondsRemaining;
52 int _shotDownByCraftId;
55 size_t _trajectoryPoint;
56 bool _detected, _hyperDetected;
57 int _shootingAt, _hitFrame;
59 void calculateSpeed();
68 YAML::Node
save(
bool newBattle)
const;
98 enum UfoStatus
getStatus()
const {
return _status; }
100 void setStatus(
enum UfoStatus status) {_status = status; }
Represents an ongoing alien mission.
Definition: AlienMission.h:46
Contains strings used throughout the game for localization.
Definition: Language.h:44
Base class for moving targets on the globe with a certain speed and destination.
Definition: MovingTarget.h:32
virtual YAML::Node save() const
Saves the moving target to YAML.
Definition: MovingTarget.cpp:69
Represents a specific type of UFO.
Definition: RuleUfo.h:38
Set of rules and stats for a game.
Definition: Ruleset.h:70
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:81
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:36
Represents an alien UFO on the map.
Definition: Ufo.h:42
~Ufo()
Cleans up the UFO.
Definition: Ufo.cpp:55
void setShotDownByCraftId(const int id)
Sets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:539
YAML::Node saveId() const
Saves the UFO's ID to YAML.
Definition: Ufo.cpp:212
size_t getTrajectoryPoint() const
Gets the UFO's progress on the trajectory track.
Definition: Ufo.h:128
void setCrashId(int id)
Sets the UFO's crash site ID.
Definition: Ufo.cpp:666
void setHitFrame(int frame)
Sets the UFO's hit frame.
Definition: Ufo.cpp:671
int getShootingAt() const
Get which interceptor this ufo is engaging.
Definition: Ufo.cpp:641
int getHitFrame()
Gets the UFO's hit frame.
Definition: Ufo.cpp:676
std::string getAltitude() const
Gets the UFO's altitude.
Definition: Ufo.cpp:355
void setDestination(Target *dest)
Sets the UFO's destination.
Definition: Ufo.cpp:634
void think()
Handles UFO logic.
Definition: Ufo.cpp:481
enum UfoStatus getStatus() const
Gets the UFO status.
Definition: Ufo.h:98
void setStatus(enum UfoStatus status)
Set the UFO's status.
Definition: Ufo.h:100
int getVisibility() const
Gets the UFO's visibility.
Definition: Ufo.cpp:555
void setShootingAt(int target)
Set which interceptor this ufo is engaging.
Definition: Ufo.cpp:646
std::string getDirection() const
Gets the UFO's direction.
Definition: Ufo.cpp:346
void setMissionInfo(AlienMission *mission, const UfoTrajectory *trajectory)
Sets the UFO's mission information.
Definition: Ufo.cpp:603
void setAltitude(const std::string &altitude)
Sets the UFO's altitude.
Definition: Ufo.cpp:364
void setDetected(bool detected)
Sets the UFO's detection status.
Definition: Ufo.cpp:315
bool isCrashed() const
Gets if the UFO has crashed.
Definition: Ufo.cpp:382
int getLandId() const
Gets the UFO's landing site ID.
Definition: Ufo.cpp:651
RuleUfo * getRules() const
Gets the UFO's ruleset.
Definition: Ufo.cpp:224
AlienMission * getMission() const
Gets the UFO's mission object.
Definition: Ufo.h:134
size_t getSecondsRemaining() const
Gets the UFO's seconds left on the ground.
Definition: Ufo.cpp:326
int getShotDownByCraftId() const
Gets the ID of craft which shot down the UFO.
Definition: Ufo.cpp:544
void setHyperDetected(bool hyperdetected)
Sets the UFO's hyper detection status.
Definition: Ufo.cpp:625
void setInBattlescape(bool inbattle)
Sets the UFO's battlescape status.
Definition: Ufo.cpp:523
const UfoTrajectory & getTrajectory() const
Gets the UFO's trajectory.
Definition: Ufo.h:132
void setSecondsRemaining(size_t seconds)
Sets the UFO's seconds left on the ground.
Definition: Ufo.cpp:337
Ufo(RuleUfo *rules)
Creates a UFO of the specified type.
Definition: Ufo.cpp:43
void setLandId(int id)
Sets the UFO's landing site ID.
Definition: Ufo.cpp:656
void setTrajectoryPoint(size_t np)
Sets the UFO's progress on the trajectory track.
Definition: Ufo.h:130
void load(const YAML::Node &node, const Ruleset &ruleset, SavedGame &game)
Loads the UFO from YAML.
Definition: Ufo.cpp:105
bool getHyperDetected() const
Gets the UFO's hyper detection status.
Definition: Ufo.cpp:616
bool isInBattlescape() const
Gets if the UFO is in battlescape.
Definition: Ufo.cpp:514
int getId() const
Gets the UFO's ID.
Definition: Ufo.cpp:234
int getDamage() const
Gets the UFO's amount of damage.
Definition: Ufo.cpp:276
const std::string & getMissionType() const
Gets the UFO's Mission type.
Definition: Ufo.cpp:590
bool isDestroyed() const
Gets if the UFO has been destroyed.
Definition: Ufo.cpp:392
void setId(int id)
Sets the UFO's ID.
Definition: Ufo.cpp:243
void setDamage(int damage)
Sets the UFO's amount of damage.
Definition: Ufo.cpp:285
const std::string & getAlienRace() const
Gets the UFO's alien race.
Definition: Ufo.cpp:534
int getCrashId() const
Gets the UFO's crash site ID.
Definition: Ufo.cpp:661
bool getDetected() const
Gets the UFO's detection status.
Definition: Ufo.cpp:306
std::wstring getName(Language *lang) const
Gets the UFO's name.
Definition: Ufo.cpp:253
Holds information about a specific trajectory.
Definition: UfoTrajectory.h:50
COPYING:
Definition: BaseInfoState.cpp:41