![]() |
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... | |
| virtual void | load (const YAML::Node &node) |
| Loads the target from YAML. More... | |
| virtual YAML::Node | save () const |
| Saves the target to YAML. More... | |
| YAML::Node | saveId () const |
| Saves the target's ID to YAML. More... | |
| virtual std::string | getType () const =0 |
| Gets the target's type. | |
| 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... | |
| int | getId () const |
| Gets the target's ID. More... | |
| void | setId (int id) |
| Sets the target's ID. More... | |
| virtual std::string | getName (Language *lang) const |
| Gets the target's name. More... | |
| void | setName (const std::string &newName) |
| Sets the target's name. More... | |
| virtual std::string | getDefaultName (Language *lang) const |
| Gets the target's default name. More... | |
| virtual std::string | getMarkerName () const |
| Gets the target's marker name. More... | |
| virtual int | getMarker () const =0 |
| Gets the target's marker sprite. | |
| std::vector< MovingTarget * > * | getFollowers () |
| Gets the target's followers. More... | |
| std::vector< Craft * > | getCraftFollowers () const |
| Gets the target's craft 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.
| std::vector< Craft * > OpenXcom::Target::getCraftFollowers | ( | ) | const |
Gets the target's craft followers.
Returns the list of crafts currently following this target.
|
virtual |
Gets the target's default name.
Returns the target's unique default name.
| lang | Language to get strings from. |
Reimplemented in OpenXcom::Ufo, and OpenXcom::Craft.
| 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< MovingTarget * > * OpenXcom::Target::getFollowers | ( | ) |
Gets the target's followers.
Returns the list of targets currently following this target.
| int OpenXcom::Target::getId | ( | ) | const |
Gets the target's ID.
Returns the target's unique ID.
| 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.
|
virtual |
Gets the target's marker name.
Returns the name on the globe for the target.
Reimplemented in OpenXcom::Ufo, and OpenXcom::MissionSite.
|
virtual |
Gets the target's name.
Returns the target's user-readable name.
If there's no custom name, the language default is used.
| lang | Language to get strings from. |
Reimplemented in OpenXcom::Base, and OpenXcom::City.
|
virtual |
Loads the target from YAML.
Loads the target from a YAML file.
| node | YAML node. |
Reimplemented in OpenXcom::MovingTarget, OpenXcom::MissionSite, and OpenXcom::AlienBase.
|
virtual |
Saves the target to YAML.
Saves the target to a YAML file.
Reimplemented in OpenXcom::Base, OpenXcom::Craft, OpenXcom::MovingTarget, OpenXcom::MissionSite, and OpenXcom::AlienBase.
| YAML::Node OpenXcom::Target::saveId | ( | ) | const |
Saves the target's ID to YAML.
Saves the target's unique identifiers to a YAML file.
| void OpenXcom::Target::setId | ( | int | id | ) |
Sets the target's ID.
Changes the target's unique ID.
| id | Unique ID. |
| 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. |
| void OpenXcom::Target::setName | ( | const std::string & | newName | ) |
Sets the target's name.
Changes the target's custom name.
| newName | New custom name. If set to blank, the language default is used. |
1.8.14