OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | List of all members
OpenXcom::Target Class Referenceabstract

Base class for targets on the globe with a set of radian coordinates. More...

#include <Target.h>

Inheritance diagram for OpenXcom::Target:
OpenXcom::AlienBase OpenXcom::Base OpenXcom::MovingTarget OpenXcom::TerrorSite OpenXcom::Waypoint OpenXcom::Craft OpenXcom::Ufo

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...
 

Detailed Description

Base class for targets on the globe with a set of radian coordinates.

Constructor & Destructor Documentation

OpenXcom::Target::Target ( )
protected

Creates a target.

Initializes a target with blank coordinates.

OpenXcom::Target::~Target ( )
virtual

Cleans up the target.

Make sure no crafts are chasing this target.

Member Function Documentation

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.

Parameters
targetPointer to other target.
Returns
Distance in radian.
std::vector< Target * > * OpenXcom::Target::getFollowers ( )

Gets the target's followers.

Returns the list of crafts currently following this target.

Returns
Pointer to list of crafts.
double OpenXcom::Target::getLatitude ( ) const

Gets the target's latitude.

Returns the latitude coordinate of the target.

Returns
Latitude in radian.
double OpenXcom::Target::getLongitude ( ) const

Gets the target's longitude.

Returns the longitude coordinate of the target.

Returns
Longitude in radian.
void OpenXcom::Target::load ( const YAML::Node &  node)

Loads the moving target from YAML.

Loads the target from a YAML file.

Parameters
nodeYAML node.
YAML::Node OpenXcom::Target::save ( ) const
virtual

Saves the target to YAML.

Saves the target to a YAML file.

Returns
YAML node.

Reimplemented in OpenXcom::Base, OpenXcom::Craft, OpenXcom::MovingTarget, OpenXcom::TerrorSite, OpenXcom::AlienBase, and OpenXcom::Waypoint.

YAML::Node OpenXcom::Target::saveId ( ) const
virtual

Saves the target's ID to YAML.

Saves the target's unique identifiers to a YAML file.

Returns
YAML node.

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.

Parameters
latLatitude in radian.
void OpenXcom::Target::setLongitude ( double  lon)

Sets the target's longitude.

Changes the longitude coordinate of the target.

Parameters
lonLongitude in radian.

The documentation for this class was generated from the following files: