OpenXcom  1.0
Open-source clone of the original X-Com
Country.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <vector>
21 #include <yaml-cpp/yaml.h>
22 
23 namespace OpenXcom
24 {
25 
26 class RuleCountry;
27 
33 class Country
34 {
35 private:
36  RuleCountry *_rules;
37  bool _pact, _newPact;
38  std::vector<int> _funding, _activityXcom, _activityAlien;
39  int _satisfaction;
40 public:
42  Country(RuleCountry *rules, bool gen = true);
44  ~Country();
46  void load(const YAML::Node& node);
48  YAML::Node save() const;
50  RuleCountry *getRules() const;
52  std::vector<int> &getFunding();
54  void setFunding(int funding);
56  int getSatisfaction() const;
58  void addActivityXcom(int activity);
60  void addActivityAlien(int activity);
62  std::vector<int> &getActivityXcom();
64  std::vector<int> &getActivityAlien();
66  void newMonth(int xcomTotal, int alienTotal, int pactScore);
68  bool getNewPact() const;
70  void setNewPact();
72  bool getPact() const;
74  void setPact();
75 };
76 
77 }
std::vector< int > & getActivityAlien()
get xcom activity to this country
Definition: Country.cpp:152
bool getNewPact() const
are we signing a new pact?
Definition: Country.cpp:231
~Country()
Cleans up the country.
Definition: Country.cpp:44
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
std::vector< int > & getActivityXcom()
get xcom activity to this country
Definition: Country.cpp:143
int getSatisfaction() const
get the country&#39;s satisfaction level
Definition: Country.cpp:114
bool getPact() const
have we signed a pact?
Definition: Country.cpp:249
Country(RuleCountry *rules, bool gen=true)
Creates a new country of the specified type.
Definition: Country.cpp:31
void newMonth(int xcomTotal, int alienTotal, int pactScore)
store last month&#39;s counters, start new counters, set this month&#39;s change.
Definition: Country.cpp:166
std::vector< int > & getFunding()
Gets the country&#39;s funding.
Definition: Country.cpp:96
void setNewPact()
sign a pact at the end of this month.
Definition: Country.cpp:239
Represents a country that funds the player.
Definition: Country.h:33
Represents a specific funding country.
Definition: RuleCountry.h:31
YAML::Node save() const
Saves the country to YAML.
Definition: Country.cpp:65
void addActivityAlien(int activity)
add alien activity in this country
Definition: Country.cpp:134
void setFunding(int funding)
Sets the country&#39;s funding.
Definition: Country.cpp:105
RuleCountry * getRules() const
Gets the country&#39;s ruleset.
Definition: Country.cpp:87
void setPact()
sign a pact immediately
Definition: Country.cpp:257
Definition: BaseInfoState.cpp:40