MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
game_grid.hpp
Go to the documentation of this file.
1#ifndef MUTATRIS_GAME_GRID_HPP
2#define MUTATRIS_GAME_GRID_HPP
3
4#include <vector>
5
6#include "common.hpp"
7#include "piece.hpp"
8
9namespace mutatris {
10
11 class GameGrid {
12 public:
13 GameGrid();
14
15 void initGrid(int width, int height);
16 [[nodiscard]] Block *at(int x, int y);
17 [[nodiscard]] const Block *at(int x, int y) const;
18 [[nodiscard]] int width() const { return gridWidth; }
19 [[nodiscard]] int height() const { return gridHeight; }
20 [[nodiscard]] bool canMoveDown() const;
21
23
24 private:
25 int gridWidth = 0;
26 int gridHeight = 0;
27 std::vector<Block> cells{};
28 };
29
30} // namespace mutatris
31
32#endif
int width() const
Definition game_grid.hpp:18
bool canMoveDown() const
Definition game_grid.cpp:32
void initGrid(int width, int height)
Definition game_grid.cpp:11
int height() const
Definition game_grid.hpp:19
Block * at(int x, int y)
Definition game_grid.cpp:18