19 #ifndef OPENXCOM_RULEREGION_H 20 #define OPENXCOM_RULEREGION_H 24 #include <yaml-cpp/yaml.h> 26 #include "../Savegame/WeightedOptions.h" 37 double lonMin, lonMax, latMin, latMax;
41 return AreSame(lonMax, ma.lonMax) && AreSame(lonMin, ma.lonMin) && AreSame(latMax, ma.latMax) && AreSame(latMin, ma.latMin);
50 std::vector<MissionArea> areas;
54 areas.swap(other.areas);
70 std::vector<double> _lonMin, _lonMax, _latMin, _latMax;
71 std::vector<City*> _cities;
77 std::vector<MissionZone> _missionZones;
79 std::string _missionRegion;
81 static const int CITY_MISSION_ZONE = 3;
82 static const int ALIEN_BASE_ZONE = 4;
88 void load(
const YAML::Node& node);
90 std::string getType()
const;
92 int getBaseCost()
const;
94 bool insideRegion(
double lon,
double lat)
const;
96 std::vector<City*> *getCities();
98 size_t getWeight()
const;
104 std::pair<double, double> getRandomPoint(
size_t site)
const;
106 const std::vector<double> &
getLonMax()
const {
return _lonMax; }
108 const std::vector<double> &
getLonMin()
const {
return _lonMin; }
110 const std::vector<double> &
getLatMax()
const {
return _latMax; }
112 const std::vector<double> &
getLatMin()
const {
return _latMin; }
113 const std::vector<MissionZone> &getMissionZones()
const;
126 node.push_back(rhs.lonMin);
127 node.push_back(rhs.lonMax);
128 node.push_back(rhs.latMin);
129 node.push_back(rhs.latMax);
135 if (!node.IsSequence() || node.size() != 4)
138 rhs.lonMin = node[0].as<
double>();
139 rhs.lonMax = node[1].as<
double>();
140 rhs.latMin = node[2].as<
double>();
141 rhs.latMax = node[3].as<
double>();
158 if (!node.IsSequence())
161 rhs.areas = node.as< std::vector<OpenXcom::MissionArea> >(rhs.areas);
const std::vector< double > & getLatMin() const
Gets the minimum latitude.
Definition: RuleRegion.h:112
const std::vector< double > & getLonMin() const
Gets the minimum longitude.
Definition: RuleRegion.h:108
Defines a rectangle in polar coordinates.
Definition: RuleRegion.h:35
A zone (set of areas) on the globe.
Definition: RuleRegion.h:48
const std::vector< double > & getLatMax() const
Gets the maximum latitude.
Definition: RuleRegion.h:110
const std::vector< double > & getLonMax() const
Gets the maximum longitude.
Definition: RuleRegion.h:106
Definition: Position.h:90
Represents a city of the world.
Definition: City.h:32
const WeightedOptions & getAvailableMissions() const
Gets the weighted list of missions for this region.
Definition: RuleRegion.h:100
const std::string & getMissionRegion() const
Gets the substitute mission region.
Definition: RuleRegion.h:102
Holds pairs of relative weights and IDs.
Definition: WeightedOptions.h:34
Represents a specific region of the world.
Definition: RuleRegion.h:65
COPYING:
Definition: BaseInfoState.cpp:40