-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (42 loc) · 1.46 KB
/
main.cpp
File metadata and controls
54 lines (42 loc) · 1.46 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
#include <iostream>
#include "Orders/Orders.h"
#include "Player/Player.h"
#include "GameEngine/GameEngine.h"
#include "CommandProcessor/CommandProcessing.h"
#include "PlayerStrategies/PlayerStrategies.h"
using namespace std;
using namespace Graph;
using namespace Players;
int main() {
auto *logObserver = new LogObserver();
Subject::attach(logObserver);
string userInput;
do {
cout << "Command list:\n"
"1. Part 1: Player Strategies\n"
"2. Part 2: Tournament Mode\n"
"3. Exit\n"
"Select the part you would like to run: ";
cin >> userInput;
cin.ignore();
cout << endl;
if (userInput == "1") {
cout << "Part 1: Player Strategies" << endl;
// clear game log file in preparation for new logs
ofstream ofs;
ofs.open("gamelog.txt", ofstream::out | ofstream::trunc);
ofs.close();
PlayerStrategiesDriver();
} else if (userInput == "2") {
cout << "Part 2: Tournament mode" << endl;
// clear game log file in preparation for new logs
ofstream ofs;
ofs.open("gamelog.txt", ofstream::out | ofstream::trunc);
ofs.close();
GameEngine::tournamentModeDriver();
} else if (userInput != "3")
cout << "ERROR: Invalid input!" << endl;
} while (userInput != "3");
delete logObserver;
return 0;
}