![]() |
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, Mod *mod) |
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 maxSizeX, int maxSizeY, int group, bool force=true) |
Gets a random mapblock. More... | |
MapBlock * | getMapBlock (const std::string &name) |
Gets a mapblock given its name. More... | |
MapData * | getMapData (unsigned int *id, int *mapDataSetID) const |
Gets the mapdata object. More... | |
std::vector< std::string > | getCivilianTypes () const |
Gets the civilian types to use. More... | |
int | getMinDepth () const |
Gets the minimum depth. More... | |
int | getMaxDepth () const |
Gets the maximum depth. More... | |
int | getAmbience () const |
Gets the ambient sound effect. More... | |
std::string | getScript () const |
Gets the generation script name. More... | |
const std::vector< std::string > & | getMusic () const |
Gets the list of music to pick from. More... | |
Represents a specific type of Battlescape Terrain.
OpenXcom::RuleTerrain::~RuleTerrain | ( | ) |
Ruleterrain only holds mapblocks.
Map datafiles are referenced.
int OpenXcom::RuleTerrain::getAmbience | ( | ) | const |
Gets the ambient sound effect.
Gets The ambient sound effect.
std::vector< std::string > OpenXcom::RuleTerrain::getCivilianTypes | ( | ) | const |
Gets the civilian types to use.
Gets the list of civilian types to use on this terrain (default MALE_CIVILIAN and FEMALE_CIVILIAN)
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 | ( | unsigned 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.
int OpenXcom::RuleTerrain::getMaxDepth | ( | ) | const |
Gets the maximum depth.
Gets the max depth.
int OpenXcom::RuleTerrain::getMinDepth | ( | ) | const |
Gets the minimum depth.
Gets the min depth.
const std::vector< std::string > & OpenXcom::RuleTerrain::getMusic | ( | ) | const |
Gets the list of music to pick from.
Gets The list of musics this terrain has to choose from.
std::string OpenXcom::RuleTerrain::getName | ( | ) | const |
Gets the terrain's name (used for MAP generation).
Gets the terrain name.
MapBlock * OpenXcom::RuleTerrain::getRandomMapBlock | ( | int | maxSizeX, |
int | maxSizeY, | ||
int | group, | ||
bool | force = true |
||
) |
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::string OpenXcom::RuleTerrain::getScript | ( | ) | const |
Gets the generation script name.
Gets The generation script name.
void OpenXcom::RuleTerrain::load | ( | const YAML::Node & | node, |
Mod * | mod | ||
) |
Loads the terrain from YAML.
Loads the terrain from a YAML file.
node | YAML node. |
mod | Mod for the terrain. |