#include <ConfigMatrix.h>
Inheritance diagram for ConfigMatrix:
Public Types | |
typedef size_t | SizeType |
Size type of the array (width / height / indexes). | |
Public Member Functions | |
ConfigMatrix (SizeType matrixWidth, SizeType matrixHeight) | |
Constructor. | |
ConfigMatrix (TiXmlElement *node) | |
Constructs object using data from XML node. | |
virtual | ~ConfigMatrix () |
Destructor. | |
virtual TiXmlElement * | CreateXmlNode () const |
Creates node representing the config. | |
void | SetWidth (SizeType matrixWidth) |
Sets matrix width. | |
SizeType | GetWidth () const |
Gets matrix width. | |
void | SetHeight (SizeType matrixHeight) |
Sets matrix height. | |
SizeType | GetHeight () const |
Gets matrix height. | |
void | AddConfigCell (const ConfigCell *cell) |
Adds selected cell to the config. | |
const ConfigCell & | GetConfigCell () const |
Returns next ConfigCell. Using this function with combination with AreThereConfigCells() you can go through stored cells in the matrix. | |
bool | AreThereConfigCells () const |
Returns true if there are config cells that can be returned by GetConfigCell(). | |
Private Types | |
typedef std::deque< const ConfigCell * > | CellsContainer |
Container type for cell configs. | |
Private Attributes | |
SizeType | width |
Width of the matrix. | |
SizeType | height |
Height of the matrix. | |
CellsContainer | container |
Container for cells configs. | |
CellsContainer::iterator | currentCell |
Iterator to the current cell (state attribute). | |
Classes | |
class | ConfigCell |
Configuration of a single cell on the matrix. More... |
typedef std::deque<const ConfigCell *> ConfigMatrix::CellsContainer [private] |
Container type for cell configs.
typedef size_t ConfigMatrix::SizeType |
Size type of the array (width / height / indexes).
Constructor.
matrixWidth | Width of the matrix | |
matrixHeight | Height of the matrix |
ConfigMatrix::ConfigMatrix | ( | TiXmlElement * | node | ) | [explicit] |
Constructs object using data from XML node.
ConfigMatrix::~ConfigMatrix | ( | ) | [virtual] |
Destructor.
void ConfigMatrix::AddConfigCell | ( | const ConfigCell * | cell | ) |
Adds selected cell to the config.
cell | Dynamicaly allocated cell's config |
bool ConfigMatrix::AreThereConfigCells | ( | ) | const [inline] |
Returns true if there are config cells that can be returned by GetConfigCell().
TiXmlElement * ConfigMatrix::CreateXmlNode | ( | ) | const [virtual] |
const ConfigMatrix::ConfigCell & ConfigMatrix::GetConfigCell | ( | ) | const |
Returns next ConfigCell. Using this function with combination with AreThereConfigCells() you can go through stored cells in the matrix.
Warning: Before you call this function you have to call AreThereConfigCells(). If there are no cells left it will throw ExceptionConfigMatrixNoCells
SizeType ConfigMatrix::GetHeight | ( | ) | const [inline] |
Gets matrix height.
SizeType ConfigMatrix::GetWidth | ( | ) | const [inline] |
Gets matrix width.
void ConfigMatrix::SetHeight | ( | SizeType | matrixHeight | ) | [inline] |
Sets matrix height.
matrixHeight | New matrix height |
void ConfigMatrix::SetWidth | ( | SizeType | matrixWidth | ) | [inline] |
Sets matrix width.
matrixWidth | New matrix width |
CellsContainer ConfigMatrix::container [private] |
Container for cells configs.
CellsContainer::iterator ConfigMatrix::currentCell [mutable, private] |
Iterator to the current cell (state attribute).
SizeType ConfigMatrix::height [private] |
Height of the matrix.
SizeType ConfigMatrix::width [private] |
Width of the matrix.