23 #include <yaml-cpp/yaml.h> 32 double lonMin, lonMax, latMin, latMax;
33 TerrainCriteria() : weight(1), lonMin(0.0), lonMax(360.0), latMin(-90.0), latMax(90.0) {};
46 std::map<std::string, int> _deployments;
47 std::vector<TerrainCriteria> _terrain;
54 void load(
const YAML::Node& node);
75 node[
"name"] = rhs.name;
76 node[
"weight"] = rhs.weight;
77 std::vector<double> area;
78 area.push_back(rhs.lonMin);
79 area.push_back(rhs.lonMax);
80 area.push_back(rhs.latMin);
81 area.push_back(rhs.latMax);
91 rhs.name = node[
"name"].as<std::string>(rhs.name);
92 rhs.weight = node[
"weight"].as<
int>(rhs.weight);
95 std::vector<double> area = node[
"area"].as< std::vector<double> >();
96 rhs.lonMin = area[0] * M_PI / 180.0;
97 rhs.lonMax = area[1] * M_PI / 180.0;
98 rhs.latMin = area[2] * M_PI / 180.0;
99 rhs.latMax = area[3] * M_PI / 180.0;
const std::map< std::string, int > & getDeployments() const
Gets the alien deployment for this texture.
Definition: Texture.cpp:98
~Texture()
Cleans up the texture.
Definition: Texture.cpp:37
void load(const YAML::Node &node)
Loads the texture from YAML.
Definition: Texture.cpp:45
std::string getRandomDeployment() const
Gets a random deployment.
Definition: Texture.cpp:108
std::vector< TerrainCriteria > * getTerrain()
Gets the list of terrain criteria.
Definition: Texture.cpp:57
Definition: Position.h:88
Represents the relations between a Geoscape texture and the corresponding Battlescape mission attribu...
Definition: Texture.h:42
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:33
std::string getRandomTerrain(Target *target) const
Gets a random texture terrain for a given target.
Definition: Texture.cpp:68
Texture(int id)
Creates a new texture with mission data.
Definition: Texture.cpp:30
Definition: BaseInfoState.cpp:40