OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RuleCountry.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_RULECOUNTRY_H
20 #define OPENXCOM_RULECOUNTRY_H
21 
22 #include <string>
23 #include <yaml-cpp/yaml.h>
24 
25 namespace OpenXcom
26 {
27 
34 {
35 private:
36  std::string _type;
37  int _fundingBase, _fundingCap;
38  double _labelLon, _labelLat;
39  std::vector<double> _lonMin, _lonMax, _latMin, _latMax;
40 public:
42  RuleCountry(const std::string &type);
44  ~RuleCountry();
46  void load(const YAML::Node& node);
48  std::string getType() const;
50  int generateFunding() const;
52  int getFundingCap() const;
54  double getLabelLongitude() const;
56  double getLabelLatitude() const;
58  bool insideCountry(double lon, double lat) const;
59  const std::vector<double> &getLonMax() const { return _lonMax; }
60  const std::vector<double> &getLonMin() const { return _lonMin; }
61  const std::vector<double> &getLatMax() const { return _latMax; }
62  const std::vector<double> &getLatMin() const { return _latMin; }
63 };
64 
65 }
66 
67 #endif
~RuleCountry()
Cleans up the country ruleset.
Definition: RuleCountry.cpp:39
double getLabelLatitude() const
Gets the country's label Y position.
Definition: RuleCountry.cpp:108
void load(const YAML::Node &node)
Loads the country from YAML.
Definition: RuleCountry.cpp:47
int generateFunding() const
Generates the country's starting funding.
Definition: RuleCountry.cpp:80
RuleCountry(const std::string &type)
Creates a blank country ruleset.
Definition: RuleCountry.cpp:32
std::string getType() const
Gets the country's type.
Definition: RuleCountry.cpp:71
double getLabelLongitude() const
Gets the country's label X position.
Definition: RuleCountry.cpp:99
Represents a specific funding country.
Definition: RuleCountry.h:33
int getFundingCap() const
Gets the country's funding cap.
Definition: RuleCountry.cpp:90
bool insideCountry(double lon, double lat) const
Checks if a point is inside the country.
Definition: RuleCountry.cpp:119