OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::MapBlock Class Reference

Represents a Terrain Map Block. More...

#include <MapBlock.h>

Public Member Functions

 MapBlock (std::string name, int size_x, int size_y, MapBlockType type)
 MapBlock construction.
 
 ~MapBlock ()
 MapBlock desctruction.
 
void load (const YAML::Node &node)
 Loads the map block from YAML. More...
 
std::string getName () const
 Gets the mapblock's name (used for MAP generation). More...
 
int getSizeX () const
 Gets the mapblock's x size. More...
 
int getSizeY () const
 Gets the mapblock's y size. More...
 
int getSizeZ () const
 Gets the mapblock's z size. More...
 
void setSizeZ (int size_z)
 Sets the mapblock's z size. More...
 
MapBlockType getType () const
 Returns whether this mapblock is a landingzone. More...
 
MapBlockType getSubType () const
 Returns whether this mapblock is a landingzone. More...
 
int getRemainingUses ()
 Gets either remaining uses or frequency. More...
 
void markUsed ()
 Decreases remaining uses. More...
 
void reset ()
 Resets remaining uses. More...
 

Detailed Description

Represents a Terrain Map Block.

It contains constant info about this mapblock, like its name, dimensions, attributes... Map blocks are stored in RuleTerrain objects.

See also
http://www.ufopaedia.org/index.php?title=MAPS_Terrain

Member Function Documentation

std::string OpenXcom::MapBlock::getName ( ) const

Gets the mapblock's name (used for MAP generation).

Gets the MapBlock name (string).

Returns
The name.
int OpenXcom::MapBlock::getRemainingUses ( )

Gets either remaining uses or frequency.

Gets either the remaining uses of the mapblock OR THE FREQUENCY! Remaining limits the number of times a mapblock occurs.

Frequency increases the odds of a mapblock occuring.

Returns
int
int OpenXcom::MapBlock::getSizeX ( ) const

Gets the mapblock's x size.

Gets the MapBlock size x.

Returns
The size x in tiles.
int OpenXcom::MapBlock::getSizeY ( ) const

Gets the mapblock's y size.

Gets the MapBlock size y.

Returns
The size y in tiles.
int OpenXcom::MapBlock::getSizeZ ( ) const

Gets the mapblock's z size.

Gets the MapBlock size z.

Returns
The size z.
MapBlockType OpenXcom::MapBlock::getSubType ( ) const

Returns whether this mapblock is a landingzone.

Gets the secondary type of the mapblock, if the primary type is occupied.

Returns
The mapblock's secondary type.
MapBlockType OpenXcom::MapBlock::getType ( ) const

Returns whether this mapblock is a landingzone.

Gets the type of mapblock.

Returns
The mapblock's type.
void OpenXcom::MapBlock::load ( const YAML::Node &  node)

Loads the map block from YAML.

Loads the map block from a YAML file.

Parameters
nodeYAML node.
void OpenXcom::MapBlock::markUsed ( )

Decreases remaining uses.

Decreases the remaining uses of a mapblock for this session.

void OpenXcom::MapBlock::reset ( )

Resets remaining uses.

Resets the remaining uses of a mapblock for this session.

void OpenXcom::MapBlock::setSizeZ ( int  size_z)

Sets the mapblock's z size.

Sets the MapBlock size z.

Parameters
size_zThe size z.

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