-
Notifications
You must be signed in to change notification settings - Fork 0
/
PField.h
67 lines (44 loc) · 1.13 KB
/
PField.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// Created by Douglas Wilcox on 2019-03-30.
//
#ifndef QT_TEST_PFIELD_H
#define QT_TEST_PFIELD_H
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QBrush>
#include <QTimer>
#include <vector>
#include <iostream>
using namespace std;
class PField : public QObject{
Q_OBJECT
public:
PField(QGraphicsScene *scene, int sizeX, int sizeY, int gridsize);
virtual ~PField();
void PFieldInit();
int GetFieldWidth();
void PutPieceToField(int index, QColor color);
void CheckForFilledRow();
int GetNumFilledRows();
void ResetNumFilledRows();
int CheckIntField(int index);
//DEBUGGING / TESTING
void PrintField();
void ResetTempIntField();
void PutTempIntField(int index);
void PrintTempIntField();
public slots:
void ClearFilledRows();
private:
int myGridSize;
int myFieldWidth;
int myFieldHeight;
QGraphicsScene* myScene;
vector<int> myIntField;
vector<int> tempIntField;
QTimer *myClearTimer;
vector<int> myFilledRows;
vector<shared_ptr<QGraphicsRectItem>> myTetrinoField;
};
#endif //QT_TEST_PFIELD_H