nsnake
Classic snake game for the terminal
|
Two-dimensional array. More...
#include <Array2D.hpp>
Public Member Functions | |
Array2D (int width, int height) | |
Creates a 2D array with width and height . | |
T | at (int x, int y) |
Returns element at x y . | |
void | set (int x, int y, const T &value) |
size_t | width () |
Width size of the array. | |
size_t | height () |
Height size of the array. | |
Two-dimensional array.
This class tries to be as simple as C's matrix handling and very extensible, with std::vector
.
Array's contents must be a type/class that has a constructor with no arguments.
So if you create your MyClass
and want a 2D array of it, make sure MyClass()
has a constructor that receive no arguments.
Definition at line 22 of file Array2D.hpp.