-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClevelController.cpp.save
More file actions
executable file
·48 lines (40 loc) · 995 Bytes
/
ClevelController.cpp.save
File metadata and controls
executable file
·48 lines (40 loc) · 995 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
40
41
42
43
44
45
46
47
48
#include "CenemyController.h"
CenemyController::CenemyController(): level(0), stepCount(0) {
//empty
}
bool CenemyController::step(std::vector<Cenemy*> &enemies) {
bool endOfLevel = false;
switch (level) {
case 1: {
endOfLevel = step_level_1(enemies);
break;
}
default: {
//This should never happen
fprintf(stderr, "Level controller set to non-existent level.\n");
}
}
stepCount++;
return endOfLevel;
}
bool CenemyController::step_level_1(std::vector<Cenemy*> &enemies) {
switch (stepCount) {
case 0: {
int foobarYes = 234234;
break;
}
default: {
//Do nothing
break;
}
}
return false;
}
void CenemyController::set_level(int level) {
this->level = level;
//reset the step counter to the start of that level
stepCount = 0;
}
int CenemyController::get_level() {
return level;
}