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::MapData Class Reference

MapData is the smallest piece of a Battlescape terrain, holding info about a certain object, wall, floor, ... More...

#include <MapData.h>

Public Member Functions

 MapData (MapDataSet *dataset)
 Creates a new Map Data Object. More...
 
 ~MapData ()
 Destroys the object.
 
MapDataSetgetDataset () const
 Gets the dataset this object belongs to. More...
 
int getSprite (int frameID) const
 Gets the sprite index for a certain frame. More...
 
void setSprite (int frameID, int value)
 Sets the sprite index for a certain frame. More...
 
bool isUFODoor () const
 Gets whether this is an animated ufo door. More...
 
bool isNoFloor () const
 Gets whether this is a floor. More...
 
int getBigWall () const
 Gets whether this is a big wall, which blocks all surrounding paths. More...
 
bool isDoor () const
 Gets whether this is a normal door. More...
 
bool isGravLift () const
 Gets whether this is a grav lift. More...
 
void setFlags (bool isUfoDoor, bool stopLOS, bool isNoFloor, int bigWall, bool isGravLift, bool isDoor, bool blockFire, bool blockSmoke, bool baseModule)
 Sets all kinds of flags. More...
 
int getBlock (ItemDamageType type) const
 Gets the amount of blockage of a certain type. More...
 
void setBlockValue (int lightBlock, int visionBlock, int HEBlock, int smokeBlock, int fireBlock, int gasBlock)
 Sets the amount of blockage for all types. More...
 
void setHEBlock (int HEBlock)
 Sets the amount of HE blockage. More...
 
int getYOffset () const
 Gets the offset on the Y axis when drawing this object. More...
 
void setYOffset (int value)
 Sets the offset on the Y axis for drawing this object. More...
 
SpecialTileType getSpecialType () const
 Gets info about special tile types. More...
 
int getObjectType () const
 Get the type of tile. More...
 
void setSpecialType (int value, int otype)
 Sets a special tile type and object type. More...
 
int getTUCost (MovementType movementType) const
 Gets the TU cost to move over the object. More...
 
void setTUCosts (int walk, int fly, int slide)
 Sets the TU cost to move over the object. More...
 
int getTerrainLevel () const
 Adds this to the graphical Y offset of units or objects on this tile. More...
 
void setTerrainLevel (int value)
 Sets Y offset for units/objects on this tile. More...
 
int getFootstepSound () const
 Gets the index to the footstep sound. More...
 
void setFootstepSound (int value)
 Sets the index to the footstep sound. More...
 
int getAltMCD () const
 Gets sthe alternative object ID. More...
 
void setAltMCD (int value)
 Sets the alternative object ID. More...
 
int getDieMCD () const
 Gets the dead object ID. More...
 
void setDieMCD (int value)
 Sets the dead object ID. More...
 
int getLightSource () const
 Gets the amount of light the object is emitting. More...
 
void setLightSource (int value)
 Sets the amount of light the object is emitting. More...
 
int getArmor () const
 Gets the amount of armor. More...
 
void setArmor (int value)
 Sets the amount of armor. More...
 
int getFlammable () const
 Gets the amount of flammable. More...
 
void setFlammable (int value)
 Sets the amount of flammable. More...
 
int getFuel () const
 Gets the amount of fuel. More...
 
void setFuel (int value)
 Sets the amount of fuel. More...
 
int getLoftID (int layer) const
 Gets the loft index for a certain layer. More...
 
void setLoftID (int loft, int layer)
 Sets the loft index for a certain layer. More...
 
int getExplosive () const
 Gets the amount of explosive. More...
 
void setExplosive (int value)
 Sets the amount of explosive. More...
 
void setMiniMapIndex (unsigned short i)
 Sets the MiniMap index. More...
 
unsigned short getMiniMapIndex () const
 Gets the MiniMap index. More...
 
void setBigWall (const int bigWall)
 Sets the bigwall value. More...
 
void setTUWalk (const int TUWalk)
 Sets the TUWalk value. More...
 
void setTUFly (const int TUFly)
 Sets the TUFly value. More...
 
void setTUSlide (const int TUSlide)
 Sets the TUSlide value. More...
 
bool isBaseModule ()
 Check if this is an xcom base object. More...
 
void setNoFloor (bool isNoFloor)
 Sets this tile as not a floor (water, etc.) More...
 

Detailed Description

MapData is the smallest piece of a Battlescape terrain, holding info about a certain object, wall, floor, ...

See also
MapDataSet.

Constructor & Destructor Documentation

OpenXcom::MapData::MapData ( MapDataSet dataset)

Creates a new Map Data Object.

Parameters
datasetThe dataset this object belongs to.

Member Function Documentation

int OpenXcom::MapData::getAltMCD ( ) const

Gets sthe alternative object ID.

Gets the alternative object ID.

Returns
The alternative object ID.
int OpenXcom::MapData::getArmor ( ) const

Gets the amount of armor.

Returns
The amount of armor.
int OpenXcom::MapData::getBigWall ( ) const

Gets whether this is a big wall, which blocks all surrounding paths.

Return value key: 0: not a bigWall 1: regular bigWall 2: allows movement in ne/sw direction 3: allows movement in nw/se direction 4: acts as a west wall 5: acts as a north wall 6: acts as an east wall 7: acts as a south wall 8: acts as a south and east wall.

Returns
An integer representing what kind of bigwall this is.
int OpenXcom::MapData::getBlock ( ItemDamageType  type) const

Gets the amount of blockage of a certain type.

Parameters
typeType.
Returns
The blockage (0-255).
MapDataSet * OpenXcom::MapData::getDataset ( ) const

Gets the dataset this object belongs to.

Returns
Pointer to MapDataSet.
int OpenXcom::MapData::getDieMCD ( ) const

Gets the dead object ID.

Returns
The dead object ID.
int OpenXcom::MapData::getExplosive ( ) const

Gets the amount of explosive.

Returns
The amount of explosive.
int OpenXcom::MapData::getFlammable ( ) const

Gets the amount of flammable.

Gets the amount of flammable (how flammable this object is).

Returns
The amount of flammable.
int OpenXcom::MapData::getFootstepSound ( ) const

Gets the index to the footstep sound.

Returns
The sound ID.
int OpenXcom::MapData::getFuel ( ) const

Gets the amount of fuel.

Returns
The amount of fuel.
int OpenXcom::MapData::getLightSource ( ) const

Gets the amount of light the object is emitting.

Returns
The amount of light emitted.
int OpenXcom::MapData::getLoftID ( int  layer) const

Gets the loft index for a certain layer.

Parameters
layerThe layer.
Returns
The loft index.
unsigned short OpenXcom::MapData::getMiniMapIndex ( ) const

Gets the MiniMap index.

Gets the SCANG.DAT index for minimap.

Returns
The minimap index.
int OpenXcom::MapData::getObjectType ( ) const

Get the type of tile.

Gets the type of object.

Returns
The object type (0-3).
SpecialTileType OpenXcom::MapData::getSpecialType ( ) const

Gets info about special tile types.

Returns
The special tile type.
int OpenXcom::MapData::getSprite ( int  frameID) const

Gets the sprite index for a certain frame.

Gets the sprite index.

Parameters
frameIDAnimation frame 0-7.
Returns
The original sprite index.
int OpenXcom::MapData::getTerrainLevel ( ) const

Adds this to the graphical Y offset of units or objects on this tile.

Returns
The Y offset.
int OpenXcom::MapData::getTUCost ( MovementType  movementType) const

Gets the TU cost to move over the object.

Gets the TU cost to walk over the object.

Parameters
movementTypeThe movement type.
Returns
The TU cost.
int OpenXcom::MapData::getYOffset ( ) const

Gets the offset on the Y axis when drawing this object.

Gets the Y offset for drawing.

Returns
The height in pixels.
bool OpenXcom::MapData::isBaseModule ( )

Check if this is an xcom base object.

check if this is an xcom base object.

Returns
if it is a base object.
bool OpenXcom::MapData::isDoor ( ) const

Gets whether this is a normal door.

Returns
True if this is a normal door.
bool OpenXcom::MapData::isGravLift ( ) const

Gets whether this is a grav lift.

Returns
True if this is a grav lift.
bool OpenXcom::MapData::isNoFloor ( ) const

Gets whether this is a floor.

Returns
True if this is a floor.
bool OpenXcom::MapData::isUFODoor ( ) const

Gets whether this is an animated ufo door.

Returns
True if this is an animated ufo door.
void OpenXcom::MapData::setAltMCD ( int  value)

Sets the alternative object ID.

Parameters
valueThe alternative object ID.
void OpenXcom::MapData::setArmor ( int  value)

Sets the amount of armor.

Parameters
valueThe amount of armor.
void OpenXcom::MapData::setBigWall ( const int  bigWall)

Sets the bigwall value.

Sets the bigWall value.

Parameters
bigWallThe new bigWall value.
void OpenXcom::MapData::setBlockValue ( int  lightBlock,
int  visionBlock,
int  HEBlock,
int  smokeBlock,
int  fireBlock,
int  gasBlock 
)

Sets the amount of blockage for all types.

Parameters
lightBlockThe light blockage.
visionBlockThe vision blockage.
HEBlockThe high explosive blockage.
smokeBlockThe smoke blockage.
fireBlockThe fire blockage.
gasBlockThe gas blockage.
void OpenXcom::MapData::setDieMCD ( int  value)

Sets the dead object ID.

Parameters
valueThe dead object ID.
void OpenXcom::MapData::setExplosive ( int  value)

Sets the amount of explosive.

Parameters
valueThe amount of explosive.
void OpenXcom::MapData::setFlags ( bool  isUfoDoor,
bool  stopLOS,
bool  isNoFloor,
int  bigWall,
bool  isGravLift,
bool  isDoor,
bool  blockFire,
bool  blockSmoke,
bool  baseModule 
)

Sets all kinds of flags.

Parameters
isUfoDoorTrue if this is a ufo door.
stopLOSTrue if this stops line of sight.
isNoFloorTrue if this is a floor.
bigWallTrue if this is a bigWall.
isGravLiftTrue if this is a grav lift.
isDoorTrue if this is a normal door.
blockFireTrue if this blocks fire.
blockSmokeTrue if this blocks smoke.
baseModuleTrue if this is a base module item.
void OpenXcom::MapData::setFlammable ( int  value)

Sets the amount of flammable.

Sets the amount of flammable (how flammable this object is).

Parameters
valueThe amount of flammable.
void OpenXcom::MapData::setFootstepSound ( int  value)

Sets the index to the footstep sound.

Parameters
valueThe sound ID.
void OpenXcom::MapData::setFuel ( int  value)

Sets the amount of fuel.

Parameters
valueThe amount of fuel.
void OpenXcom::MapData::setHEBlock ( int  HEBlock)

Sets the amount of HE blockage.

Parameters
HEBlockThe high explosive blockage.
void OpenXcom::MapData::setLightSource ( int  value)

Sets the amount of light the object is emitting.

Parameters
valueThe amount of light emitted.
void OpenXcom::MapData::setLoftID ( int  loft,
int  layer 
)

Sets the loft index for a certain layer.

Parameters
loftThe loft index.
layerThe layer.
void OpenXcom::MapData::setMiniMapIndex ( unsigned short  i)

Sets the MiniMap index.

Sets the SCANG.DAT index for minimap.

Parameters
iThe minimap index.
void OpenXcom::MapData::setNoFloor ( bool  isNoFloor)

Sets this tile as not a floor (water, etc.)

set the "no floor" flag.

Parameters
isNoFloorset the flag to THIS.
void OpenXcom::MapData::setSpecialType ( int  value,
int  otype 
)

Sets a special tile type and object type.

Parameters
valueSpecial tile type.
otypeObject type.
void OpenXcom::MapData::setSprite ( int  frameID,
int  value 
)

Sets the sprite index for a certain frame.

Parameters
frameIDAnimation frame
valueThe sprite index in the surfaceset of the mapdataset.
void OpenXcom::MapData::setTerrainLevel ( int  value)

Sets Y offset for units/objects on this tile.

Sets the Y offset for units/objects on this tile.

Parameters
valueThe Y offset.
void OpenXcom::MapData::setTUCosts ( int  walk,
int  fly,
int  slide 
)

Sets the TU cost to move over the object.

Parameters
walkThe walking TU cost.
flyThe flying TU cost.
slideThe sliding TU cost.
void OpenXcom::MapData::setTUFly ( const int  TUFly)

Sets the TUFly value.

Parameters
TUFlyThe new TUFly value.
void OpenXcom::MapData::setTUSlide ( const int  TUSlide)

Sets the TUSlide value.

Parameters
TUSlideThe new TUSlide value.
void OpenXcom::MapData::setTUWalk ( const int  TUWalk)

Sets the TUWalk value.

Parameters
TUWalkThe new TUWalk value.
void OpenXcom::MapData::setYOffset ( int  value)

Sets the offset on the Y axis for drawing this object.

Parameters
valueThe offset.

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