OpenXcom  1.0
Open-source clone of the original X-Com
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...
 
std::vector< int > & getFunding ()
 Gets the country's funding. More...
 
void setFunding (int funding)
 Sets the country's funding. More...
 
int getSatisfaction () const
 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...
 
std::vector< int > & getActivityXcom ()
 get xcom activity to this country More...
 
std::vector< int > & getActivityAlien ()
 get xcom activity to this country More...
 
void newMonth (int xcomTotal, int alienTotal, int pactScore)
 store last month's counters, start new counters, set this month's change. More...
 
bool getNewPact () const
 are we signing a new pact? More...
 
void setNewPact ()
 sign a pact at the end of this month. More...
 
bool getPact () const
 have we signed a pact? More...
 
void setPact ()
 sign a pact immediately 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

◆ Country()

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

◆ addActivityAlien()

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.

◆ addActivityXcom()

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.

◆ getActivityAlien()

std::vector< int > & OpenXcom::Country::getActivityAlien ( )

get xcom activity to this country

Gets the country's alien activity level.

Returns
activity level.

◆ getActivityXcom()

std::vector< int > & OpenXcom::Country::getActivityXcom ( )

get xcom activity to this country

Gets the country's xcom activity level.

Returns
activity level.

◆ getFunding()

std::vector< int > & OpenXcom::Country::getFunding ( )

Gets the country's funding.

Returns the country's current monthly funding.

Returns
Monthly funding.

◆ getNewPact()

bool OpenXcom::Country::getNewPact ( ) const

are we signing a new pact?

Returns
if we will sign a new pact.

◆ getPact()

bool OpenXcom::Country::getPact ( ) const

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.

◆ getRules()

RuleCountry * OpenXcom::Country::getRules ( ) const

Gets the country's ruleset.

Returns the ruleset for the country's type.

Returns
Pointer to ruleset.

◆ load()

void OpenXcom::Country::load ( const YAML::Node &  node)

Loads the country from YAML.

Loads the country from a YAML file.

Parameters
nodeYAML node.

◆ newMonth()

void OpenXcom::Country::newMonth ( int  xcomTotal,
int  alienTotal,
int  pactScore 
)

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
pactScorethe penalty for signing a pact

◆ save()

YAML::Node OpenXcom::Country::save ( ) const

Saves the country to YAML.

Saves the country to a YAML file.

Returns
YAML node.

◆ setFunding()

void OpenXcom::Country::setFunding ( int  funding)

Sets the country's funding.

Changes the country's current monthly funding.

Parameters
fundingMonthly funding.

◆ setNewPact()

void OpenXcom::Country::setNewPact ( )

sign a pact at the end of this month.

sign a new pact at month's end.

◆ setPact()

void OpenXcom::Country::setPact ( )

sign a pact immediately

sign a new pact.


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