-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpiece.h
44 lines (37 loc) · 850 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
36
37
38
39
40
41
42
43
#ifndef PIECE_H
#define PIECE_H
#include <cstddef>
#include <vector>
#include <memory>
class Piece {
// coords represent (row, col) NOT (x,y)
std::vector<std::vector<int>> initialCoords;
std::vector<std::vector<int>> coords;
std::vector<std::vector<int>> potentialCoords;
char type;
bool isHeavy = false;
int levelGenerated = 0;
public:
Piece(char type, int level);
void makeHeavy();
void removeHeavy();
bool checkHeavy();
int getLevel();
void incRows(int num);
// Piece movement
void left();
void right();
void down();
void rotateCW();
void rotateCCW();
// Manipulate Piece
void set();
void revert();
void reset();
std::vector<std::vector<int>> getCoords();
std::vector<std::vector<int>> getPotentialCoords();
char getType();
// View
std::vector<std::vector<char>> render();
};
#endif