-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpuissancequatre.h
72 lines (53 loc) · 1.49 KB
/
puissancequatre.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
#ifndef PUISSANCEQUATRE_H
#define PUISSANCEQUATRE_H
#include <QMainWindow>
#include <QList>
#include <QLabel>
#include <QWidget>
#include <QObject>
#include <QVector>
#include <QPushButton>
#include <QString>
#include <QtGlobal>
#include <QMessageBox>
#include <QRandomGenerator>
#include "qpushbuttoncustom.h"
namespace Ui
{
class PuissanceQuatre;
}
class PuissanceQuatre : public QMainWindow
{
Q_OBJECT
public:
explicit PuissanceQuatre(QWidget *parent = 0);
~PuissanceQuatre();
void disableAllButton();
void enableAllButton();
int randomButton();
void addScore(int nbButton, QString player);
void checkWin(int row, int col, QString player);
bool checkRow(int row, QString player);
bool checkCol(int row, int col, QString player);
bool checkRightDiagonale(int row, int col, QString player);
bool checkLeftDiagonale(int row, int col, QString player);
void onModeSelected(bool bot);
private slots:
void on_pushButton(int);
// void play();
private:
Ui::PuissanceQuatre *ui;
bool _win = false;
bool _bot = false;
static const int _ROW = 6;
static const int _COL = 7;
int _gridRemaining = _ROW * _COL;
// Tableau 2D de QLabel
QLabel *_gridGameQlabel[_ROW][_COL];
// Tableau 2D de scores, same size with gridGameQlabel
QString _scores[_ROW][_COL] = {{""}};
// Tableau avec nos boutons
QPushButtonCustom *_gridQPushButton[_COL];
QString _currentPlayer = "player1";
};
#endif // PUISSANCEQUATRE_H