-
Notifications
You must be signed in to change notification settings - Fork 0
/
eventhandleplaypage.h
86 lines (69 loc) · 2.1 KB
/
eventhandleplaypage.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef EVENTHANDLEPLAYPAGE_H
#define EVENTHANDLEPLAYPAGE_H
#include <QObject>
#include <QPushButton>
class EventHandlePlayPage : public QObject
{
Q_OBJECT
public:
explicit EventHandlePlayPage(QObject *parent = 0);
/*!
* returns the Box availability.
* If the passed Box (Box number) has been clicked already, it will return false. Otherwise true.
* Used to check the Box status when user tries to click on a Box.
*/
bool returnBoxState(qint8);
/*!
* Returns whether the player 1 has won or not.
* This will check if the player 1 has already clicked on 3 boxes in straight.
*/
bool isPlayer1Won();
/*!
* Returns whether the player 2 has won or not.
* This will check if the player 2 has already clicked on 3 boxes in straight.
*/
bool isPlayer2Won();
/*!
* Returns whether the all the boxes have been filled by the players.
* Used to check if the game status is draw.
*/
bool isAllBoxesFilled();
signals:
public slots:
/*!
* Mark the Box as checked.
* Will pass the Box number and the Player identification. Player 1 represents true.
* This is used to remember who has clicked what.
*/
void checkTheBox(qint8, bool);
private:
bool isBox1X1CheckedP1;
bool isBox1X2CheckedP1;
bool isBox1X3CheckedP1;
bool isBox2X1CheckedP1;
bool isBox2X2CheckedP1;
bool isBox2X3CheckedP1;
bool isBox3X1CheckedP1;
bool isBox3X2CheckedP1;
bool isBox3X3CheckedP1;
bool isBox1X1CheckedP2;
bool isBox1X2CheckedP2;
bool isBox1X3CheckedP2;
bool isBox2X1CheckedP2;
bool isBox2X2CheckedP2;
bool isBox2X3CheckedP2;
bool isBox3X1CheckedP2;
bool isBox3X2CheckedP2;
bool isBox3X3CheckedP2;
bool isBox1X1AvailableToClick;
bool isBox1X2AvailableToClick;
bool isBox1X3AvailableToClick;
bool isBox2X1AvailableToClick;
bool isBox2X2AvailableToClick;
bool isBox2X3AvailableToClick;
bool isBox3X1AvailableToClick;
bool isBox3X2AvailableToClick;
bool isBox3X3AvailableToClick;
int boxClickCount;
};
#endif // EVENTHANDLEPLAYPAGE_H