-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
43 lines (32 loc) · 1.05 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMessageBox>
#include <QGridLayout>
#include "cell.h"
class MainWindow : public QMainWindow
{
Q_OBJECT
//Field of size///
const static int sizeField = 16;
const static int mineNumber = 40;
int countVictory = sizeField * sizeField - mineNumber;
//Massive of cell
Cell *mass[sizeField][sizeField];
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
bool isValid(int i, int j); //Checking the boundaries
void setHazard(int row, int column); //set level hazard for cell
void openZero(int row, int column); //open cell with zero hazard
void openValue(int row, int column); //open cell other
void openAll(); //Game over
public slots:
void resetGame(); //Generation cells with mines
private slots:
void init(QGridLayout *gameField); // Create GameField
void clickedLeft(int row, int column);
void clickedRight(int row, int column);
};
#endif // MAINWINDOW_H