-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmmwindow.h
60 lines (42 loc) · 1.15 KB
/
mmwindow.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
#ifndef MMWINDOW_H
#define MMWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <map>
#include "Mastermind.hxx"
namespace Ui {
class MMWindow;
}
class MMWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MMWindow(QWidget *parent = nullptr);
~MMWindow();
private slots:
void on_pushEnter_clicked();
void on_pushRed_clicked();
void on_pushGreen_clicked();
void on_pushBlue_clicked();
void on_pushBlack_clicked();
void on_pushPurple_clicked();
void on_pushWhite_clicked();
void on_pushDel_clicked();
void on_pushOrange_clicked();
void on_actionExit_triggered();
void on_actionNew_Game_triggered();
private:
Ui::MMWindow *ui;
Mastermind *game = new Mastermind();
std::vector<QLabel*> _ai_choice_row;
std::vector<std::vector<QLabel*>> _player_rows;
std::vector<unsigned int> _current_turn;
std::vector<std::vector<QLabel*>> _result_rows;
std::map<QString, QPixmap> _peg_colour_files;
std::map<pegBool, QPixmap> _result_pegs;
void resetGame();
void insertColour(Colour);
void checkPlayerChoices();
void revealAIChoice();
};
#endif // MMWINDOW_H