parent
e88ff1ebe6
commit
c6308d5388
@ -1,17 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <TileType.hpp>
|
#include <TileType.hpp>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class BlockType {
|
class BlockType {
|
||||||
public:
|
public:
|
||||||
static BlockType i, j, l, o, s, t, z;
|
|
||||||
static BlockType* list[];
|
|
||||||
static BlockType* random() {
|
|
||||||
return list[rand() % 7];
|
|
||||||
}
|
|
||||||
TileType* tile_type;
|
TileType* tile_type;
|
||||||
std::vector<std::vector<bool>> grid;
|
std::vector<std::vector<bool>> grid;
|
||||||
uint width, height, starting_line;
|
uint width, height, starting_line;
|
||||||
bool rotate;
|
bool rotate;
|
||||||
BlockType(TileType* _tile_type, const std::vector<std::vector<bool>> _grid, bool _rotate = true);
|
BlockType(TileType* _tile_type, const std::vector<std::vector<bool>> _grid, bool _rotate = true);
|
||||||
|
|
||||||
|
static BlockType* random();
|
||||||
|
static void init();
|
||||||
|
private:
|
||||||
|
inline static std::vector<BlockType> list = {};
|
||||||
|
inline static bool inited = false;
|
||||||
};
|
};
|
Loading…
Reference in new issue