-
Notifications
You must be signed in to change notification settings - Fork 0
/
Objects.h
48 lines (36 loc) · 1.13 KB
/
Objects.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
44
45
46
47
48
#ifndef TETRIS_OBJECTS_H
#define TETRIS_OBJECTS_H
#include <vector>
#include "Figure.h"
#include "figures/J.h"
#include "figures/L.h"
#include "figures/I.h"
#include "figures/O.h"
#include "figures/Z.h"
#include "figures/T.h"
#include "figures/S.h"
class Objects
{
public:
Objects();
~Objects();
public:
void updateFigures(float &spentTime);
int checkForCompletedRows();
void deleteRow(int i);
void reshapeRows(int index);
void checkForLose();
Figure* generateNewFigure();
void createCopyOfNextFigure();
void accruePoint(int countOfCompletedRows);
public:
Figure* fallingFigure = nullptr; // Падающая фигура
Figure* nextFigure = nullptr; // Следующая фигура
Figure* copyOfNextFigure = nullptr;
std::vector<Square> fallenSquares; // Вектор всех Square упавших фигур
unsigned int** table; // Таблица позиций тетриса "0" - свободный квадрат, "1" - занятый
int score = 0;
int lineCount = 0;
bool lost = false;
};
#endif //TETRIS_OBJECTS_H