-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpiece.h
35 lines (29 loc) · 824 Bytes
/
piece.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "define.h"
#include "tetromino.h"
namespace gm {
extern std::vector<std::pair<int,int>> kick_transation;
class Piece {
public:
Piece(Tetromino& t, int x0, int y0, int i, bool bt,int bt_cnt,std::shared_ptr<Matrix> p_pf);
Piece() = default;
void down();
void left();
void right();
void left_rotate();
void right_rotate();
void rotate(int op);
void drop();
std::pair<int, int> get_mino(int i);
std::pair<int,int> get_xy();
int get_color();
bool test(int x, int y);
int bottom_cnt;
bool bottom;
private:
Tetromino tetr_set;
int index; // 0 L 2 R
int x, y;
std::shared_ptr<Matrix> p_playfiled;
};
}; // namespace gm