-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel.cpp
More file actions
39 lines (34 loc) · 721 Bytes
/
level.cpp
File metadata and controls
39 lines (34 loc) · 721 Bytes
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
#include "level.h"
Level::Level(std::string gate, std::string room) {
for (int i = 0; i < gate.length(); i++) {
switch (gate[i]) {
case '-':
case 'U':
case 'T':
this->gates.push_back(i);
break;
default:
break;
}
}
if (room.empty()) {
for (int i = 0; i < gate.size(); i++)
this->room.push_back(EMPTY);
}
for (int i = 0; i < room.length(); i++) {
switch (room[i]) {
case '-':
this->room.push_back(EMPTY);
break;
default:
this->room.push_back(WALL);
break;
}
}
}
const std::vector<uint8_t>& Level::get_gates() const {
return this->gates;
}
const std::vector<uint8_t>& Level::get_room() const {
return this->room;
}