-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControl.cpp
More file actions
58 lines (51 loc) · 1.03 KB
/
Control.cpp
File metadata and controls
58 lines (51 loc) · 1.03 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
#include "Control.h"
#include "util.h"
#include "Stages.h"
#include <windows.h>
#include <iostream>
using namespace std;
Control::Control() {
player = new Player();
}
Control::~Control() {
delete player;
}
void Control::Hello() {
cout << "Welcome to the KEX game.\n";
Beep(500, 500); Beep(1000, 500); Beep(1500, 300); Beep(1500, 300); Beep(1500, 900);
cout << "Do you need tutorial? (0: yes, 1: no)\n";
Parser par;
par.readLine();
if (par.getLastCommand() == 0) {
currentStage = new Stage0;
} else {
currentStage = new Stage1;
}
}
void Control::LoadStage(Stage *) {}
void Control::Run() {
}
void Commander::addCommand(int num, Command* c) {
for (int i = 1; i < 1024; ++i) {
if (comn[i] == 0) {
comn[i] = num;
coms[i] = c;
}
}
}
void Commander::setCommand(int num, Command * c) {
for (int i = 0; i < 1024; ++i) {
if (comn[i] == num) {
delete coms[i];
coms[i] = c;
}
}
}
void Commander::remCommand(int num) {
for (int i = 1; i < 1024; ++i) {
if (comn[i] == num) {
comn[i] = 0;
delete coms[i];
}
}
}