nsnake
Classic snake game for the terminal
Public Member Functions | List of all members
Array2D< T > Class Template Reference

Two-dimensional array. More...

#include <Array2D.hpp>

Public Member Functions

 Array2D (int width, int height)
 Creates a 2D array with width and height.
 
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.
 

Detailed Description

template<class T>
class Array2D< T >

Two-dimensional array.

This class tries to be as simple as C's matrix handling and very extensible, with std::vector.

Note

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.


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