![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a specific region of the world. More...
#include <RuleRegion.h>
Public Member Functions | |
RuleRegion (const std::string &type) | |
Creates a blank region ruleset. More... | |
~RuleRegion () | |
Cleans up the region ruleset. More... | |
void | load (const YAML::Node &node) |
Loads the region from YAML. More... | |
std::string | getType () const |
Gets the region's type. More... | |
int | getBaseCost () const |
Gets the region's base cost. More... | |
bool | insideRegion (double lon, double lat) const |
Checks if a point is inside the region. More... | |
std::vector< City * > * | getCities () |
Gets the cities in this region. More... | |
size_t | getWeight () const |
Gets the weight of this region for mission selection. More... | |
const WeightedOptions & | getAvailableMissions () const |
Gets the weighted list of missions for this region. | |
const std::string & | getMissionRegion () const |
Gets the substitute mission region. | |
std::pair< double, double > | getRandomPoint (size_t zone) const |
Gets a random point inside a mission zone. More... | |
MissionArea | getMissionPoint (size_t zone, Target *target) const |
Gets the mission area for the corresponding target. More... | |
MissionArea | getRandomMissionPoint (size_t zone) const |
Gets a random mission area. More... | |
const std::vector< double > & | getLonMax () const |
Gets the maximum longitude. | |
const std::vector< double > & | getLonMin () const |
Gets the minimum longitude. | |
const std::vector< double > & | getLatMax () const |
Gets the maximum latitude. | |
const std::vector< double > & | getLatMin () const |
Gets the minimum latitude. | |
const std::vector< MissionZone > & | getMissionZones () const |
Gets a list of MissionZones. More... | |
Represents a specific region of the world.
Contains constant info about a region like area covered and base construction costs.
OpenXcom::RuleRegion::RuleRegion | ( | const std::string & | type | ) |
Creates a blank region ruleset.
Creates a blank ruleset for a certain type of region.
type | String defining the type. |
OpenXcom::RuleRegion::~RuleRegion | ( | ) |
Cleans up the region ruleset.
Deletes the cities from memory.
int OpenXcom::RuleRegion::getBaseCost | ( | ) | const |
Gets the region's base cost.
Gets the cost of building a base inside this region.
std::vector< City * > * OpenXcom::RuleRegion::getCities | ( | ) |
Gets the cities in this region.
Gets the list of cities contained in this region.
MissionArea OpenXcom::RuleRegion::getMissionPoint | ( | size_t | zone, |
Target * | target | ||
) | const |
Gets the mission area for the corresponding target.
Gets the area data for the mission point in the specified zone and coordinates.
zone | The target zone. |
target | The target coordinates. |
const std::vector< MissionZone > & OpenXcom::RuleRegion::getMissionZones | ( | ) | const |
Gets a list of MissionZones.
Gets a list of all the missionZones in the region.
MissionArea OpenXcom::RuleRegion::getRandomMissionPoint | ( | size_t | zone | ) | const |
Gets a random mission area.
Gets the area data for the random mission point in the region.
std::pair< double, double > OpenXcom::RuleRegion::getRandomPoint | ( | size_t | zone | ) | const |
Gets a random point inside a mission zone.
Gets a random point that is guaranteed to be inside the given zone.
zone | The target zone. |
std::string OpenXcom::RuleRegion::getType | ( | ) | const |
Gets the region's type.
Gets the language string that names this region.
Each region type has a unique name.
size_t OpenXcom::RuleRegion::getWeight | ( | ) | const |
Gets the weight of this region for mission selection.
This is only used when creating a new game, since these weights change in the course of the game.
bool OpenXcom::RuleRegion::insideRegion | ( | double | lon, |
double | lat | ||
) | const |
Checks if a point is inside the region.
Checks if a point is inside this region.
lon | Longitude in radians. |
lat | Latitude in radians. |
void OpenXcom::RuleRegion::load | ( | const YAML::Node & | node | ) |
Loads the region from YAML.
Loads the region type from a YAML file.
node | YAML node. |