![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
Base class for targets on the globe with a set of radian coordinates. More...
#include <Target.h>
Public Member Functions | |
| virtual | ~Target () |
| Cleans up the target. More... | |
| void | load (const YAML::Node &node) |
| Loads the moving target from YAML. More... | |
| virtual YAML::Node | save () const |
| Saves the target to YAML. More... | |
| virtual YAML::Node | saveId () const |
| Saves the target's ID to YAML. More... | |
| double | getLongitude () const |
| Gets the target's longitude. More... | |
| void | setLongitude (double lon) |
| Sets the target's longitude. More... | |
| double | getLatitude () const |
| Gets the target's latitude. More... | |
| void | setLatitude (double lat) |
| Sets the target's latitude. More... | |
| virtual std::wstring | getName (Language *lang) const =0 |
| Gets the target's name. | |
| std::vector< Target * > * | getFollowers () |
| Gets the target's followers. More... | |
| double | getDistance (const Target *target) const |
| Gets the distance to another target. More... | |
Protected Member Functions | |
| Target () | |
| Creates a target. More... | |
Base class for targets on the globe with a set of radian coordinates.
|
protected |
Creates a target.
Initializes a target with blank coordinates.
|
virtual |
Cleans up the target.
Make sure no crafts are chasing this target.
| double OpenXcom::Target::getDistance | ( | const Target * | target | ) | const |
Gets the distance to another target.
Returns the great circle distance to another target on the globe.
| target | Pointer to other target. |
| std::vector< Target * > * OpenXcom::Target::getFollowers | ( | ) |
Gets the target's followers.
Returns the list of crafts currently following this target.
| double OpenXcom::Target::getLatitude | ( | ) | const |
Gets the target's latitude.
Returns the latitude coordinate of the target.
| double OpenXcom::Target::getLongitude | ( | ) | const |
Gets the target's longitude.
Returns the longitude coordinate of the target.
| void OpenXcom::Target::load | ( | const YAML::Node & | node | ) |
Loads the moving target from YAML.
Loads the target from a YAML file.
| node | YAML node. |
|
virtual |
Saves the target to YAML.
Saves the target to a YAML file.
Reimplemented in OpenXcom::Base, OpenXcom::Craft, OpenXcom::MovingTarget, OpenXcom::TerrorSite, OpenXcom::AlienBase, and OpenXcom::Waypoint.
|
virtual |
Saves the target's ID to YAML.
Saves the target's unique identifiers to a YAML file.
Reimplemented in OpenXcom::Base, OpenXcom::Ufo, OpenXcom::Craft, OpenXcom::TerrorSite, OpenXcom::AlienBase, and OpenXcom::Waypoint.
| void OpenXcom::Target::setLatitude | ( | double | lat | ) |
Sets the target's latitude.
Changes the latitude coordinate of the target.
| lat | Latitude in radian. |
| void OpenXcom::Target::setLongitude | ( | double | lon | ) |
Sets the target's longitude.
Changes the longitude coordinate of the target.
| lon | Longitude in radian. |
1.8.6