Public Member Functions | Private Member Functions | Private Attributes

mapLayer Class Reference

A layer container. More...

#include <Layer.h>

List of all members.

Public Member Functions

 mapLayer (TiXmlNode *node, const std::string &name, int width, int height)
 mapLayer (const std::string &name, int width, int height)
 ~mapLayer ()
void setTile (Uint x, Uint y, Uint tsetId, Uint tsetIndex)
Uint getTileSetId (Uint x, Uint y)
Uint getTileIndex (Uint x, Uint y)
TilegetTile (Uint x, Uint y)
bool isLoaded ()
const std::string & getName ()

Private Member Functions

bool parseTiles (TiXmlNode *node)

Private Attributes

Uint mWidth
Uint mHeight
bool mIsLoaded
TileGrid mTileGrid
string mName

Detailed Description

A layer container.

The mapLayer class contains tiles associated with a layer. Note that this class should not be used by itself outside of the Map Class.


Constructor & Destructor Documentation

mapLayer::mapLayer ( TiXmlNode *  node,
const std::string &  name,
int  width,
int  height 
)
mapLayer::mapLayer ( const std::string &  name,
int  width,
int  height 
)
mapLayer::~mapLayer (  ) 

Member Function Documentation

const std::string& mapLayer::getName (  )  [inline]
Tile& mapLayer::getTile ( Uint  x,
Uint  y 
) [inline]
Uint mapLayer::getTileIndex ( Uint  x,
Uint  y 
) [inline]
Uint mapLayer::getTileSetId ( Uint  x,
Uint  y 
) [inline]
bool mapLayer::isLoaded (  )  [inline]
bool mapLayer::parseTiles ( TiXmlNode *  node  )  [private]

Internal parser function.

Parameters:
node Pointer to a TinyXML node.

This function is only called internally and should never be accessed outside the Class.

void mapLayer::setTile ( Uint  x,
Uint  y,
Uint  tsetId,
Uint  tsetIndex 
)

Inserts a Tile from a TileSet at the given map X/Y coordinates.

Parameters:
x Map X Location.
y Map Y Location.
tset Tset ID.
tsetIndex Tset Tile Index.

Member Data Documentation

Height of the TileGrid.

bool mapLayer::mIsLoaded [private]

Internal flag indicating whether or not we properly loaded.

string mapLayer::mName [private]

Name of the Layer. Used in the editor.

A 2D array of Tile objects.

Width of the TileGrid.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines