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::Country Class Reference

Represents a country that funds the player. More...

#include <Country.h>

Public Member Functions

 Country (RuleCountry *rules, bool gen=true)
 Creates a new country of the specified type. More...
 
 ~Country ()
 Cleans up the country.
 
void load (const YAML::Node &node)
 Loads the country from YAML. More...
 
YAML::Node save () const
 Saves the country to YAML. More...
 
RuleCountrygetRules () const
 Gets the country's ruleset. More...
 
const std::vector< int > & getFunding () const
 Gets the country's funding. More...
 
void setFunding (int funding)
 Sets the country's funding. More...
 
int getSatisfaction ()
 get the country's satisfaction level
 
void addActivityXcom (int activity)
 add xcom activity in this country More...
 
void addActivityAlien (int activity)
 add alien activity in this country More...
 
const std::vector< int > & getActivityXcom () const
 get xcom activity to this country More...
 
const std::vector< int > & getActivityAlien () const
 get xcom activity to this country More...
 
void newMonth (int xcomTotal, int alienTotal)
 store last month's counters, start new counters, set this month's change. More...
 
bool getNewPact ()
 are we signing a new pact? More...
 
void setNewPact ()
 sign a pact at the end of this month. More...
 
bool getPact ()
 have we signed a pact? More...
 

Detailed Description

Represents a country that funds the player.

Contains variable info about a country like monthly funding and various activities.

Constructor & Destructor Documentation

OpenXcom::Country::Country ( RuleCountry rules,
bool  gen = true 
)

Creates a new country of the specified type.

Initializes a country of the specified type.

Parameters
rulesPointer to ruleset.
genGenerate new funding.

Member Function Documentation

void OpenXcom::Country::addActivityAlien ( int  activity)

add alien activity in this country

Adds to the country's alien activity level.

Parameters
activityhow many points to add.
void OpenXcom::Country::addActivityXcom ( int  activity)

add xcom activity in this country

Adds to the country's xcom activity level.

Parameters
activityhow many points to add.
const std::vector< int > & OpenXcom::Country::getActivityAlien ( ) const

get xcom activity to this country

Gets the country's alien activity level.

Returns
activity level.
const std::vector< int > & OpenXcom::Country::getActivityXcom ( ) const

get xcom activity to this country

Gets the country's xcom activity level.

Returns
activity level.
const std::vector< int > & OpenXcom::Country::getFunding ( ) const

Gets the country's funding.

Returns the country's current monthly funding.

Returns
Monthly funding.
bool OpenXcom::Country::getNewPact ( )

are we signing a new pact?

Returns
if we will sign a new pact.
bool OpenXcom::Country::getPact ( )

have we signed a pact?

no setter for this one, as it gets set automatically at month's end if _newPact is set.

Returns
if we have signed a pact.
RuleCountry * OpenXcom::Country::getRules ( ) const

Gets the country's ruleset.

Returns the ruleset for the country's type.

Returns
Pointer to ruleset.
void OpenXcom::Country::load ( const YAML::Node &  node)

Loads the country from YAML.

Loads the country from a YAML file.

Parameters
nodeYAML node.
void OpenXcom::Country::newMonth ( int  xcomTotal,
int  alienTotal 
)

store last month's counters, start new counters, set this month's change.

reset all the counters, calculate this month's funding, set the change value for the month.

Parameters
xcomTotalthe council's xcom score
alienTotalthe council's alien score
YAML::Node OpenXcom::Country::save ( ) const

Saves the country to YAML.

Saves the country to a YAML file.

Returns
YAML node.
void OpenXcom::Country::setFunding ( int  funding)

Sets the country's funding.

Changes the country's current monthly funding.

Parameters
fundingMonthly funding.
void OpenXcom::Country::setNewPact ( )

sign a pact at the end of this month.

sign a new pact at month's end.


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