19 Grid(
int rows,
int columns);
70 std::vector<std::vector<GridCell*>>
getGrid();
144 std::vector<std::vector<GridCell *>> grid;
149 std::vector<GridCell*> spawnCells;
CellType
Definition: celltype.hpp:3
Definition: gridcell.hpp:23
void writeToFile(std::string path)
Definition: grid.cpp:93
GridCell * getCell(int x, int y)
Attempts to retrieve a GridCell at the specified location. Note: This function asserts if the coordin...
Definition: grid.cpp:45
void addCell(int x, int y, CellType type)
Adds a GridCell of the specified type at the given location. If the type is CellType::Spawn,...
Definition: grid.cpp:25
std::vector< std::vector< GridCell * > > getGrid()
Returns the 2-D GridCell vector maintained by this Grid.
Definition: grid.cpp:66
~Grid()
Definition: grid.cpp:21
Grid()
Definition: grid.hpp:11
static float const grid_cell_width
The width, in meters, of each GridCell in this grid.
Definition: grid.hpp:101
glm::vec3 getRandomSpawnPoint()
randomly selects a spawn point
Definition: grid.cpp:74
std::vector< GridCell * > getSpawnPoints()
Returns the vector of spawn point GridCells in this grid.
Definition: grid.cpp:70
glm::vec3 gridCellCenterPosition(GridCell *cell)
Returns the center position (as an Object position vector) of the given GridCell's center.
Definition: grid.cpp:82
int getRows() const
Returns the number of rows in this Grid.
Definition: grid.cpp:58
static std::vector< glm::ivec2 > getCellsFromPositionRange(glm::vec3 p1, glm::vec3 p2)
Returns a vector of positions of GridCells that contain the rectangle that extends from p1 to p2 (ass...
Definition: grid.cpp:132
int getColumns() const
Returns the number of columns in this Grid.
Definition: grid.cpp:62
static glm::ivec2 getGridCellFromPosition(glm::vec3 position)
Returns the position of the GridCell that would contain the given position.
Definition: grid.cpp:116
GLint GLenum GLint x
Definition: glad.h:1655
GLint y
Definition: glad.h:1516
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glad.h:1531