#include <examples/mutatris/game_grid.hpp>
Definition at line 11 of file game_grid.hpp.
◆ GameGrid()
| mutatris::GameGrid::GameGrid |
( |
| ) |
|
◆ at() [1/2]
| Block * mutatris::GameGrid::at |
( |
int | x, |
|
|
int | y ) |
|
nodiscard |
Definition at line 16 of file game_grid.cpp.
16 {
17 if (x < 0 || x >= gridWidth || y < 0 || y >= gridHeight) {
18 return nullptr;
19 }
20 return &cells[static_cast<std::size_t>(y * gridWidth + x)];
21 }
◆ at() [2/2]
| const Block * mutatris::GameGrid::at |
( |
int | x, |
|
|
int | y ) const |
|
nodiscard |
Definition at line 23 of file game_grid.cpp.
23 {
24 if (x < 0 || x >= gridWidth || y < 0 || y >= gridHeight) {
25 return nullptr;
26 }
27 return &cells[static_cast<std::size_t>(y * gridWidth + x)];
28 }
◆ canMoveDown()
| bool mutatris::GameGrid::canMoveDown |
( |
| ) |
const |
|
nodiscard |
Definition at line 30 of file game_grid.cpp.
bool checkLocation(int next_x, int next_y) const
◆ height()
| int mutatris::GameGrid::height |
( |
| ) |
const |
|
inlinenodiscard |
◆ initGrid()
| void mutatris::GameGrid::initGrid |
( |
int | width, |
|
|
int | height ) |
◆ width()
| int mutatris::GameGrid::width |
( |
| ) |
const |
|
inlinenodiscard |
◆ gamePiece
| Piece mutatris::GameGrid::gamePiece |
The documentation for this class was generated from the following files: