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 | List of all members
OpenXcom::RuleCountry Class Reference

Represents a specific funding country. More...

#include <RuleCountry.h>

Public Member Functions

 RuleCountry (const std::string &type)
 Creates a blank country ruleset. More...
 
 ~RuleCountry ()
 Cleans up the country ruleset.
 
void load (const YAML::Node &node)
 Loads the country from YAML. More...
 
std::string getType () const
 Gets the country's type. More...
 
int generateFunding () const
 Generates the country's starting funding. More...
 
int getFundingCap () const
 Gets the country's funding cap. More...
 
double getLabelLongitude () const
 Gets the country's label X position. More...
 
double getLabelLatitude () const
 Gets the country's label Y position. More...
 
bool insideCountry (double lon, double lat) const
 Checks if a point is inside the country. More...
 

Detailed Description

Represents a specific funding country.

Contains constant info like its location in the world and starting funding range.

Constructor & Destructor Documentation

OpenXcom::RuleCountry::RuleCountry ( const std::string &  type)

Creates a blank country ruleset.

Creates a blank ruleset for a certain type of country.

Parameters
typeString defining the type.

Member Function Documentation

int OpenXcom::RuleCountry::generateFunding ( ) const

Generates the country's starting funding.

Generates the random starting funding for the country.

Returns
The monthly funding.
int OpenXcom::RuleCountry::getFundingCap ( ) const

Gets the country's funding cap.

Country funding can never exceed this.

Returns
The funding cap, in thousands.
double OpenXcom::RuleCountry::getLabelLatitude ( ) const

Gets the country's label Y position.

Gets the latitude of the country's label on the globe.

Returns
The latitude in radians.
double OpenXcom::RuleCountry::getLabelLongitude ( ) const

Gets the country's label X position.

Gets the longitude of the country's label on the globe.

Returns
The longitude in radians.
std::string OpenXcom::RuleCountry::getType ( ) const

Gets the country's type.

Gets the language string that names this country.

Each country type has a unique name.

Returns
The country's name.
bool OpenXcom::RuleCountry::insideCountry ( double  lon,
double  lat 
) const

Checks if a point is inside the country.

Checks if a point is inside this country.

Parameters
lonLongitude in radians.
latLatitude in radians.
Returns
True if it's inside, false if it's outside.
void OpenXcom::RuleCountry::load ( const YAML::Node &  node)

Loads the country from YAML.

Loads the country type from a YAML file.

Parameters
nodeYAML node.

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