diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..8aa9677 --- /dev/null +++ b/main.cpp | |||
@@ -0,0 +1,31 @@ | |||
1 | #include "fefisms.h" | ||
2 | |||
3 | int main(int argc, char** argv) | ||
4 | { | ||
5 | std::random_device randomDevice; | ||
6 | std::mt19937 rng(randomDevice()); | ||
7 | |||
8 | if (argc != 2) | ||
9 | { | ||
10 | std::cout << "usage: fefisms [configfile]" << std::endl; | ||
11 | return -1; | ||
12 | } | ||
13 | |||
14 | std::string configfile(argv[1]); | ||
15 | |||
16 | try | ||
17 | { | ||
18 | fefisms bot(configfile, rng); | ||
19 | |||
20 | try | ||
21 | { | ||
22 | bot.run(); | ||
23 | } catch (const std::exception& ex) | ||
24 | { | ||
25 | std::cout << "Error running bot: " << ex.what() << std::endl; | ||
26 | } | ||
27 | } catch (const std::exception& ex) | ||
28 | { | ||
29 | std::cout << "Error initializing bot: " << ex.what() << std::endl; | ||
30 | } | ||
31 | } | ||