OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Country.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_COUNTRY_H
20 #define OPENXCOM_COUNTRY_H
21 
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 
27 class RuleCountry;
28 
34 class Country
35 {
36 private:
37  RuleCountry *_rules;
38  bool _pact, _newPact;
39  std::vector<int> _funding, _activityXcom, _activityAlien;
40  int _satisfaction;
41 public:
43  Country(RuleCountry *rules, bool gen = true);
45  ~Country();
47  void load(const YAML::Node& node);
49  YAML::Node save() const;
51  RuleCountry *getRules() const;
53  const std::vector<int> &getFunding() const;
55  void setFunding(int funding);
57  int getSatisfaction();
59  void addActivityXcom(int activity);
61  void addActivityAlien(int activity);
63  const std::vector<int>&getActivityXcom() const;
65  const std::vector<int> &getActivityAlien() const;
67  void newMonth(int xcomTotal, int alienTotal);
69  bool getNewPact();
71  void setNewPact();
73  bool getPact();
74 };
75 
76 }
77 
78 #endif
const std::vector< int > & getFunding() const
Gets the country's funding.
Definition: Country.cpp:96
const std::vector< int > & getActivityXcom() const
get xcom activity to this country
Definition: Country.cpp:143
RuleCountry * getRules() const
Gets the country's ruleset.
Definition: Country.cpp:87
~Country()
Cleans up the country.
Definition: Country.cpp:44
YAML::Node save() const
Saves the country to YAML.
Definition: Country.cpp:65
void newMonth(int xcomTotal, int alienTotal)
store last month's counters, start new counters, set this month's change.
Definition: Country.cpp:165
void addActivityXcom(int activity)
add xcom activity in this country
Definition: Country.cpp:125
void load(const YAML::Node &node)
Loads the country from YAML.
Definition: Country.cpp:52
int getSatisfaction()
get the country's satisfaction level
Definition: Country.cpp:114
const std::vector< int > & getActivityAlien() const
get xcom activity to this country
Definition: Country.cpp:152
Country(RuleCountry *rules, bool gen=true)
Creates a new country of the specified type.
Definition: Country.cpp:31
void setNewPact()
sign a pact at the end of this month.
Definition: Country.cpp:240
Represents a country that funds the player.
Definition: Country.h:34
Represents a specific funding country.
Definition: RuleCountry.h:33
void addActivityAlien(int activity)
add alien activity in this country
Definition: Country.cpp:134
bool getNewPact()
are we signing a new pact?
Definition: Country.cpp:232
void setFunding(int funding)
Sets the country's funding.
Definition: Country.cpp:105
bool getPact()
have we signed a pact?
Definition: Country.cpp:250