-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel.cpp
More file actions
94 lines (82 loc) · 1.57 KB
/
Level.cpp
File metadata and controls
94 lines (82 loc) · 1.57 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
#include"Level.h"
Level::Level()
{
levelNumber = 0;
targetScore = 0;
candiesToClear = 0;
moves = 0;
rows = 0;
cols = 0;
difficulty = " ";
}
Level::Level(int ln, int ts, int CC, int m, int r, int c, string d)
{
levelNumber = ln;
targetScore = ts;
candiesToClear = CC;
moves = m;
rows = r;
cols = c;
difficulty = d;
}
void Level::UpdateAttributes(int ln, int ts, int CC, int m, int r, int c, string d)
{
levelNumber = ln;
targetScore = ts;
candiesToClear = CC;
moves = m;
rows = r;
cols = c;
difficulty = d;
}
int Level::getLevelNumber()
{
return levelNumber;
}
int Level::getTargetScore()
{
return targetScore;
}
int Level::getCandiesToClear()
{
return candiesToClear;
}
int Level::getMoves()
{
return moves;
}
int Level::getRows()
{
return rows;
}
int Level::getCols()
{
return cols;
}
string Level::getDifficulty()
{
return difficulty;
}
bool Level::operator==(Level& Obj)
{
if (levelNumber == Obj.levelNumber)
{
Obj.levelNumber = levelNumber;
Obj.candiesToClear = candiesToClear;
Obj.targetScore = targetScore;
Obj.moves = moves;
Obj.difficulty = difficulty;
Obj.rows = rows;
Obj.cols = cols;
return true;
}
return false;
}
void Level::display()
{
cout << "levelNumber: " << levelNumber << endl;
cout << "targetScore: " << targetScore << endl;
cout << "candiesToClear: " << candiesToClear << endl;
cout << "moves " << moves << endl;
cout << "difficulty: " << difficulty << endl;
}