-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZeroLev.cc
More file actions
71 lines (58 loc) · 1.23 KB
/
Copy pathZeroLev.cc
File metadata and controls
71 lines (58 loc) · 1.23 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
#include "ZeroLev.h"
#include "block.h"
#include <iostream>
#include <fstream>
#include <string>
ZeroLev::ZeroLev(std::string source) {
this -> selfLevel = 0;
this -> source = source;
this->same = 0;
}
Block * ZeroLev::NextBlock(int loc) {
this -> getOldBlocks();
int j = loc % (this -> blocks.size());
if (this -> blocks[j] == 'I') return new iblock {
false
};
else if (this -> blocks[j] == 'J') return new jblock {
false
};
else if (this -> blocks[j] == 'L') return new lblock {
false
};
else if (this -> blocks[j] == 'O') return new oblock {
false
};
else if (this -> blocks[j] == 'S') return new sblock {
false
};
else if (this -> blocks[j] == 'Z') return new zblock {
false
};
else return new tblock {
false
};
}
void ZeroLev::getOldBlocks() {
char state;
this -> inputFile.open(source);
while (this -> inputFile >> state) {
this -> blocks.emplace_back(state);
}
}
int ZeroLev::getLevel() {
return this -> selfLevel;
}
std::string ZeroLev::getInputFile() {
return this -> source;
}
bool ZeroLev::randomCheck() {
return false;
}
void ZeroLev::toggleSame() {
this->same += 1;
}
void ZeroLev::setSame(int same) {
this->same = same;
}
ZeroLev::~ZeroLev() {}