Repository navigation
Expand file tree
/
Copy pathdifficultyselect.cpp
More file actions
115 lines (99 loc) · 2.4 KB
/
Copy pathdifficultyselect.cpp
File metadata and controls
115 lines (99 loc) · 2.4 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include "difficultyselect.h"
difficultySelect::difficultySelect() :
m_windowWidth(500),
m_windowHeight(565),
m_fieldWidth(500),
m_fieldHeight(500),
m_cellWidth(50),
m_cellHeight(50),
m_numBombs(10),
m_columns(10),
m_rows(10)
{}
void difficultySelect::setEasy() {
m_windowWidth = 500;
m_windowHeight = 565;
m_fieldWidth = 500;
m_fieldHeight = 500;
m_cellWidth = 50;
m_cellHeight = 50;
m_numBombs = 10;
m_columns = 10;
m_rows = 10;
emit isWindowHeightChanged();
emit isWidnowWidthChanged();
emit isFieldWidthChanged();
emit isFieldHeightChanged();
emit isCellWidthChanged();
emit isCellHeightChanged();
emit isNumBombsChanged();
emit isColumnsChanged();
emit isRowsChanged();
}
void difficultySelect::setNormal() {
m_windowWidth = 480;
m_windowHeight = 545;
m_fieldWidth = 480;
m_fieldHeight = 480;
m_cellWidth = 30;
m_cellHeight = 30;
m_numBombs = 40;
m_columns = 16;
m_rows = 16;
emit isWindowHeightChanged();
emit isWidnowWidthChanged();
emit isFieldWidthChanged();
emit isFieldHeightChanged();
emit isCellWidthChanged();
emit isCellHeightChanged();
emit isNumBombsChanged();
emit isColumnsChanged();
emit isRowsChanged();
}
void difficultySelect::setHard() {
m_windowWidth = 750;
m_windowHeight = 465;
m_fieldWidth = 750;
m_fieldHeight = 750;
m_cellWidth = 25;
m_cellHeight = 25;
m_numBombs = 99;
m_columns = 30;
m_rows = 16;
emit isWindowHeightChanged();
emit isWidnowWidthChanged();
emit isFieldWidthChanged();
emit isFieldHeightChanged();
emit isCellWidthChanged();
emit isCellHeightChanged();
emit isNumBombsChanged();
emit isColumnsChanged();
emit isRowsChanged();
}
int difficultySelect::windowWidth() const {
return m_windowWidth;
}
int difficultySelect::widnowHeight() const {
return m_windowHeight;
}
int difficultySelect::fieldWidth() const {
return m_fieldWidth;
}
int difficultySelect::fieldHeight() const {
return m_fieldHeight;
}
int difficultySelect::cellWidth() const {
return m_cellWidth;
}
int difficultySelect::cellHeight() const {
return m_cellHeight;
}
int difficultySelect::numBombs() const {
return m_numBombs;
}
int difficultySelect::columns() const {
return m_columns;
}
int difficultySelect::rows() const {
return m_rows;
}