OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a specific type of Battlescape Terrain. More...
#include <RuleTerrain.h>
Public Member Functions | |
RuleTerrain (const std::string &name) | |
RuleTerrain construction. | |
~RuleTerrain () | |
Ruleterrain only holds mapblocks. More... | |
void | load (const YAML::Node &node, Ruleset *ruleset) |
Loads the terrain from YAML. More... | |
std::string | getName () const |
Gets the terrain's name (used for MAP generation). More... | |
std::vector< MapBlock * > * | getMapBlocks () |
Gets the terrain's mapblocks. More... | |
std::vector< MapDataSet * > * | getMapDataSets () |
Gets the terrain's mapdatafiles. More... | |
MapBlock * | getRandomMapBlock (int maxsize, MapBlockType type, bool force=false) |
Gets a random mapblock. More... | |
MapBlock * | getMapBlock (const std::string &name) |
Gets a mapblock given its name. More... | |
MapData * | getMapData (int *id, int *mapDataSetID) const |
Gets the mapdata object. More... | |
int | getLargeBlockLimit () const |
Gets the maximum amount of large blocks in this terrain. More... | |
void | resetMapBlocks () |
Resets the remaining uses of each mapblock. | |
std::vector< int > * | getTextures () |
Gets the array of globe texture IDs this terrain is loaded on. More... | |
int | getHemisphere () const |
Gets the hemishpere this terrain occurs on. More... | |
std::vector< std::string > | getCivilianTypes () const |
Gets teh civilian types to use. More... | |
std::vector< int > | getRoadTypeOdds () const |
Gets road type odds. More... | |
Represents a specific type of Battlescape Terrain.
OpenXcom::RuleTerrain::~RuleTerrain | ( | ) |
Ruleterrain only holds mapblocks.
Map datafiles are referenced.
std::vector< std::string > OpenXcom::RuleTerrain::getCivilianTypes | ( | ) | const |
Gets teh civilian types to use.
Gets the list of civilian types to use on this terrain (default MALE_CIVILIAN and FEMALE_CIVILIAN)
int OpenXcom::RuleTerrain::getHemisphere | ( | ) | const |
Gets the hemishpere this terrain occurs on.
-1 = northern, 0 = either, 1 = southern.
int OpenXcom::RuleTerrain::getLargeBlockLimit | ( | ) | const |
Gets the maximum amount of large blocks in this terrain.
MapBlock * OpenXcom::RuleTerrain::getMapBlock | ( | const std::string & | name | ) |
Gets a mapblock given its name.
Gets a mapblock with a given name.
name | The name of the mapblock. |
std::vector< MapBlock * > * OpenXcom::RuleTerrain::getMapBlocks | ( | ) |
Gets the terrain's mapblocks.
Gets the array of mapblocks.
MapData * OpenXcom::RuleTerrain::getMapData | ( | int * | id, |
int * | mapDataSetID | ||
) | const |
Gets the mapdata object.
Gets a mapdata object.
id | The id in the terrain. |
mapDataSetID | The id of the map data set. |
std::vector< MapDataSet * > * OpenXcom::RuleTerrain::getMapDataSets | ( | ) |
Gets the terrain's mapdatafiles.
Gets the array of mapdatafiles.
std::string OpenXcom::RuleTerrain::getName | ( | ) | const |
Gets the terrain's name (used for MAP generation).
Gets the terrain name.
MapBlock * OpenXcom::RuleTerrain::getRandomMapBlock | ( | int | maxsize, |
MapBlockType | type, | ||
bool | force = false |
||
) |
Gets a random mapblock.
Gets a random mapblock within the given constraints.
maxsize | The maximum size of the mapblock (10 or 20 or 999 - don't care). |
type | Whether this must be a block of a certain type. |
force | Whether to enforce the max size. |
std::vector< int > OpenXcom::RuleTerrain::getRoadTypeOdds | ( | ) | const |
Gets road type odds.
Gets the road type odds.
std::vector< int > * OpenXcom::RuleTerrain::getTextures | ( | ) |
Gets the array of globe texture IDs this terrain is loaded on.
void OpenXcom::RuleTerrain::load | ( | const YAML::Node & | node, |
Ruleset * | ruleset | ||
) |
Loads the terrain from YAML.
Loads the terrain from a YAML file.
node | YAML node. |
ruleset | Ruleset for the terrain. |