-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
48 lines (46 loc) · 946 Bytes
/
main.cpp
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 "Gloomhaven.h"
#include "ReadCharacterData.h"
#include "ReadMonsterData.h"
int main(int argc, char* argv[])
{
string characterFile = "character1.txt";
string monsterFile = "monster1.txt";
string debugMode = "0";
if (argc >= 4)
{
characterFile = argv[1];
monsterFile = argv[2];
debugMode = argv[3];
}
int debug;
if (debugMode == "1")
debug = 1;
else if (debugMode == "0")
debug = 0;
else
{
cout << "Error. " << endl;
return 0;
}
string command;
while (1)
{
cin >> command;
while (command != "play" && command != "exit" && command != "EXIT")
{
cout << "Unrecognized command. " << endl;
cout << "Please re-enter the command: " << endl;
cin >> command;
}
if (command == "play")
{
cout << endl;
cout << "A new game start!!!" << endl;
Gloomhaven game(characterFile, monsterFile, debug);
game.showIntroduction("introduction.txt");
game.startGame();
}
else
return 0;
}
}