1 #ifndef ARRAY2D_H_DEFINED 2 #define ARRAY2D_H_DEFINED 32 return contents[x][y];
35 void set(
int x,
int y,
const T& value)
37 contents[x][y] = value;
48 std::vector<std::vector<T> > contents;
60 contents.resize(width);
62 for (
int i = 0; i <
width; i++)
63 contents[i].resize(height);
69 return contents.size();
75 return contents[0].size();
78 #endif //ARRAY2D_H_DEFINED size_t width()
Width size of the array.
size_t height()
Height size of the array.
T at(int x, int y)
Returns element at x y.
Array2D(int width, int height)
Creates a 2D array with width and height.