29 inline int x()
const {
return xc; }
35 inline int y()
const {
return yc; }
51 template<
typename cell_t>
53 vector<vector<vector<cell_t *>>>
grid;
76 grid.resize(w, vector<vector<cell_t *>>(h, vector<cell_t *>()));
77 for(
int i = 0 ; i < w ; ++i)
grid[i].resize(h, vector<cell_t *>());
A simple vector class template.
Namespace for 2D grid-related structures and classes.
Template class representing a 2D grid of cell pointers.
CellGrid()
Default constructor initializing the grid with default width and height.
void resizeGrid(int w, int h)
Set the grid size to given width and height.
void setToreY(bool b)
Set the toreY property.
void setToreX(bool b)
Set the toreX property.
void setTore(bool x, bool y)
Set both toreX and toreY properties.
void resizeGrid(int size)
Set the grid size to a square of given size.
vector< vector< vector< cell_t * > > > grid
Structure representing a 2D vector.
Vec2D(int x_, int y_)
Constructor to initialize the vector with given coordinates.
int x() const
Get the X-coordinate.
int y() const
Get the Y-coordinate.
bool operator==(Vec2D v)
Equality operator to compare two Vec2D objects.