OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::MapScript Class Reference

Public Member Functions

void load (const YAML::Node &node)
 Loads information from a ruleset file. More...
 
void init ()
 Initializes all the variables and junk for a mapscript command. More...
 
MapScriptCommand getType () const
 Gets what type of command this is.
 
const std::vector< SDL_Rect * > * getRects () const
 Gets the rects, describing the areas this command applies to.
 
int getSizeX () const
 Gets the X size for this command.
 
int getSizeY () const
 Gets the Y size for this command.
 
int getSizeZ () const
 Gets the Z size for this command.
 
int getChancesOfExecution () const
 Get the chances of this command executing.
 
int getLabel () const
 Gets the label for this command.
 
int getExecutions () const
 Gets how many times this command repeats (1 repeat means 2 executions)
 
const std::vector< int > * getConditionals () const
 Gets what conditions apply to this command.
 
const std::vector< int > * getGroups () const
 Gets the groups vector for iteration.
 
const std::vector< int > * getBlocks () const
 Gets the blocks vector for iteration.
 
MapDirection getDirection () const
 Gets the direction this command goes (for lines and tunnels).
 
TunnelDatagetTunnelData ()
 Gets the mcd replacement data for tunnel replacements.
 
MapBlockgetNextBlock (RuleTerrain *terrain)
 Randomly generate a block from within either the array of groups or blocks. More...
 
std::string getUFOName () const
 Gets the UFO's name (for setUFO) More...
 

Member Function Documentation

◆ getNextBlock()

MapBlock * OpenXcom::MapScript::getNextBlock ( RuleTerrain terrain)

Randomly generate a block from within either the array of groups or blocks.

Gets a random map block from a given terrain, using either the groups or the blocks defined.

Parameters
terrainthe terrain to pick a block from.
Returns
Pointer to a randomly chosen map block, given the options available.

◆ getUFOName()

std::string OpenXcom::MapScript::getUFOName ( ) const

Gets the UFO's name (for setUFO)

Gets the name of the UFO in the case of "setUFO".

Returns
the UFO name.

◆ init()

void OpenXcom::MapScript::init ( )

Initializes all the variables and junk for a mapscript command.

Initializes all the various scratch values and such for the command.

◆ load()

void OpenXcom::MapScript::load ( const YAML::Node &  node)

Loads information from a ruleset file.

Loads a map script command from YAML.

Parameters
nodethe YAML node from which to read.

The documentation for this class was generated from the following files: