-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
43 lines (35 loc) · 1.06 KB
/
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
#include "gui/controller/Controller.h"
int main(int argc, char **argv) {
std::string name = "team";
std::string password;
std::string gameName;
int numberTurns = 45;
int numberPlayers = 1;
bool observer = false;
//parsing arguments
for (int i = 1; i < argc; i += 2) {
std::string key(argv[i]);
char *value = argv[i + 1];
if(key == "-n"){
name = value;
}else if(key == "-pa"){
password = value;
}else if(key == "-g"){
gameName = value;
}else if(key == "-t"){
numberTurns = std::stoi(value);
}else if(key == "-pl"){
numberPlayers = std::stoi(value);
}else if(key == "-o"){
observer = std::stoi(value);
}
}
AIClient bot(name, password, gameName, numberTurns, numberPlayers, observer);
sf::Thread thread(&AIClient::StartAI, &bot);
thread.launch();
// bot.StartAI();
// Gui with 3 our bots
Controller controller(gameName, 0, numberPlayers);
thread.wait();
return 0;
}