Nimbus  0.2
A game... with arrows... which should be clouds
 All Classes Functions Variables Enumerations Enumerator
Nimbus::Grid< T > Class Template Reference

#include <Grid.h>

Public Member Functions

 Grid (int xLength, int yLength)
 
void initialize (T value)
 
void erase ()
 
get (int posx, int posy)
 
void set (int posx, int posy, T value)
 
int getXDimension ()
 
int getYDimension ()
 
std::string str ()
 

Detailed Description

template<class T>
class Nimbus::Grid< T >

Stores a grid of objects of type T. Provides basic 2d array niceties... etc.

Constructor & Destructor Documentation

template<class T>
Nimbus::Grid< T >::Grid ( int  xLength,
int  yLength 
)
inline

Constructs a grid of the given x and y dimensions.

Parameters
xLengthThe X dimension of the grid
yLengthThe Y dimension of the grid

Member Function Documentation

template<class T>
void Nimbus::Grid< T >::erase ( )
inline

Erases all the elements in the grid (though it may not delete them if they're pointers)

template<class T>
T Nimbus::Grid< T >::get ( int  posx,
int  posy 
)
inline

Gets element from location (x, y)

Parameters
posxThe x position of the element
posyThe y position of the element
Returns
The value of the given element

Here is the caller graph for this function:

template<class T>
int Nimbus::Grid< T >::getXDimension ( )
inline

Gets the x dimension of the grid.

Returns
The size of the x dimension

Here is the caller graph for this function:

template<class T>
int Nimbus::Grid< T >::getYDimension ( )
inline

Gets the y dimension of the grid

Returns
The size of the y dimension

Here is the caller graph for this function:

template<class T>
void Nimbus::Grid< T >::initialize ( value)
inline

Initializes the entire grid to the given value.

Parameters
valueThe value to which the entire grid should be initialized.

Here is the caller graph for this function:

template<class T>
void Nimbus::Grid< T >::set ( int  posx,
int  posy,
value 
)
inline

Sets element to value at position (x, y)

Parameters
posxThe x position of the element
posyThe y position of the element
valueThe value to store in the given element

Here is the caller graph for this function:

template<class T>
std::string Nimbus::Grid< T >::str ( )
inline

Uses the component element's capability to be written to a stream to construct a string representation of the Grid object.

Returns
A string representation of the Grid object.

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