Implementation of a TileSet class.
More...
#include <TileSet.h>
List of all members.
Detailed Description
Implementation of a TileSet class.
- Todo:
- Fucking hell this should really be a base class with derived implementations for each type of tile (square, isometric, hexagonal, whatever else).
Member Enumeration Documentation
- Enumerator:
| ENCODING_FLATFILE |
|
| ENCODING_EMBEDDED |
|
Constructor & Destructor Documentation
| TileSet::TileSet |
( |
const std::string & |
filePath |
) |
|
| TileSet::TileSet |
( |
int |
width, |
|
|
int |
height | |
|
) |
| | |
'Default' TileSet constructor.
This constructor is used to create a 'default' TileSet which contains a single default tile.
| TileSet::TileSet |
( |
const TileSet & |
copy |
) |
|
Member Function Documentation
| const std::string& TileSet::getFileName |
( |
|
) |
[inline] |
Gets the source file name.
- Returns:
- Returns a
std::string containing the flat file of the TileSet.
| const std::string& TileSet::getName |
( |
|
) |
[inline] |
Gets the name of the TileSet.
- Returns:
- Returns a
std::string containing the name of the TileSet.
| int TileSet::getNumTiles |
( |
|
) |
const [inline] |
Gets the number of tiles stored in the TileSet.
- Returns:
- Returns an
int indicating the number of stored tiles.
Gets a tile.
- Parameters:
-
- Returns:
- Returns an
Image Resource containing the tile. Returns NULL if the index was out of bounds.
Returns a pointer to an Image at specified index.
- Parameters:
-
| index | Non-negative tile index. |
- Returns:
- Pointer to an Image object. NULL on error.
| int TileSet::getTileHeight |
( |
|
) |
const [inline] |
Gets height of the tiles stored in the TileSet.
- Returns:
- Returns an
int indicating the height of the stored tiles.
| const std::string & TileSet::getTileName |
( |
Uint |
index |
) |
const |
Gets the name of an individual tile.
| int TileSet::getTileThickness |
( |
|
) |
const [inline] |
Gets height in pixels of the tiles stored in the TileSet.
Some tiles in a TileSet may be 'taller' than the standard tile. This value indicated the actual height of the tiles.
- Note:
- This function should not be confused with
getSizeHeight().
- Returns:
- Returns an
int indicating the height in pixels of the stored tiles.
| int TileSet::getTileWidth |
( |
|
) |
const [inline] |
Gets width of the tiles stored in the TileSet.
- Returns:
- Returns an
int indicating the width of the stored tiles.
| bool TileSet::isLoaded |
( |
|
) |
const [inline] |
Gets width of the tiles stored in the TileSet.
- Returns:
- Returns an
int indicating the width of the stored tiles.
| bool TileSet::parseChildren |
( |
TiXmlNode * |
node |
) |
[private] |
Parses all children of the TileSet node.
- Parameters:
-
| node | A pointer to the first child node of the root node. |
- Returns:
- Returns
true if no errors occured during all low-level processing and parsing. False otherwise.
| bool TileSet::parseHeader |
( |
TiXmlNode * |
node |
) |
[private] |
Parses the attributes of the TileSet node.
- Parameters:
-
| node | A pointer to the root XML node. |
- Returns:
- Returns
true if no errors occured while parsing the TileSet.
| bool TileSet::parseSheet |
( |
TiXmlNode * |
node |
) |
[private] |
Parses an individual sheet node.
- Parameters:
-
| node | A pointer to a 'sheet' node. |
- Returns:
- Returns
true if no errors occured during sheet parsing. False otherwise.
- Todo:
- Implement processing of the various attributes of sheet.
- Todo:
- The current method of processing allows for the user to define more than one 'img' or 'blend' node and the parser will blindly accept it. A sheet should have exactly one 'img' node and exactly one 'blend' node.
- Todo:
- The current method of processing allows the user to define the 'img' and 'blend' nodes in whatever order they want and it goes ahead and calls functions whenever if finds a valid node. This should instead first check for the 'blend' node and, once that's been found, should then go and find the 'img' node.
| bool TileSet::processSheet |
( |
const std::string & |
filePath, |
|
|
_ImageEncoding |
encoding | |
|
) |
| | [private] |
| void TileSet::readXml |
( |
const std::string & |
filePath |
) |
[private] |
Member Data Documentation
Flag indicating that the TileSet loaded properly.
List of names for each tile.
The documentation for this class was generated from the following files:
- C:/Development/LoM/client/src/Core/Map/Components/TileSet.h
- C:/Development/LoM/client/src/Core/Map/Components/TileSet.cpp