-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
34 lines (28 loc) · 898 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
#include <iostream>
#include <exception>
#include "ClientOptions.h"
#include "Client.h"
static const constexpr char helpMessage[] = "This is Bomberman game client.\n"
"Flags:\n"
" -h, --help\n"
" -d, --display-address (Required)\n"
" -n, --player-name (Required)\n"
" -p, --port (Required)\n"
" -s, --server-address (Required)\n";
int main(int argc, char *argv[]) {
using namespace std;
using namespace bomberman;
try {
ClientOptions options {argc, argv};
Client client {options};
client.run();
}
catch (ClientOptions::HelpException &exception) {
cout << helpMessage << endl;
}
catch (exception &exception) {
cerr << exception.what() << endl;
return 1;
}
return 0;
}