#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 18 of file game_grid.cpp.
18 {
19 if (x < 0 || x >= gridWidth || y < 0 || y >= gridHeight) {
20 return nullptr;
21 }
22 return &cells[static_cast<std::size_t>(y * gridWidth + x)];
23 }
◆ at() [2/2]
| const Block * mutatris::GameGrid::at |
( |
int | x, |
|
|
int | y ) const |
|
nodiscard |
Definition at line 25 of file game_grid.cpp.
25 {
26 if (x < 0 || x >= gridWidth || y < 0 || y >= gridHeight) {
27 return nullptr;
28 }
29 return &cells[static_cast<std::size_t>(y * gridWidth + x)];
30 }
◆ canMoveDown()
| bool mutatris::GameGrid::canMoveDown |
( |
| ) |
const |
|
nodiscard |
◆ 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: