-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogic.hpp
73 lines (57 loc) · 1.28 KB
/
logic.hpp
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef LOGIC
#define LOGIC
#include <vector>
#include <string>
#include <algorithm>
#include "tetromino.hpp"
#include "config.inl"
using namespace std;
class Logic
{
private:
vector<string> colorMatrix;
vector<string> nextMatrix;
vector<bool> logicMatrix;
Tetromino activePiece;
Tetromino nextPiece;
Pixel coorZero;
vector<Pixel> savedPos;
vector<Pixel> curr_overlay;
vector<Pixel> prev_overlay;
bool locked;
int score;
int level;
int rows;
int localRows;
int slowness;
int special_counter;
int status; //0 start, 1 tutorial, 2 singleplayer, 3 pause, 4 gameover, 5 - 11 multiplayer
bool hardDrop;
int logicX;
int logicY;
public:
Logic(int argRows, int argColumns);
vector<string> getMatrix() const;
vector<string> getNext();
int getScore();
int getLevel();
int getRows();
void setStatus(int);
int getStatus();
int GetSlowness();
void newTetromino();
void updateMatrix();
void fillNextMatrix();
void moveTetromino(char);
void rotateTetromino();
void deleteRow();
void CalcLevel();
void CalcScore(int);
void CalcSlowness();
void ActivateHardDrop();
void Overlay();
void CheckGameOver();
void CleanUp();
~Logic();
};
#endif