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 = Deg2Rad(area[0]);
97 rhs.lonMax = Deg2Rad(area[1]);
98 rhs.latMin = Deg2Rad(area[2]);
99 rhs.latMax = Deg2Rad(area[3]);
const std::map< std::string, int > & getDeployments() const
Gets the alien deployment for this texture.
Definition: Texture.cpp:101
~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:111
std::vector< TerrainCriteria > * getTerrain()
Gets the list of terrain criteria.
Definition: Texture.cpp:57
Definition: Position.h:81
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:35
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