diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-28 16:08:46 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-28 16:08:46 -0400 |
commit | 10a402f32a6d443e959b2caed187bccf161c1645 (patch) | |
tree | 54da9d9a47bddc39f1a51eab4a20d36f0e4433a2 /main.cpp | |
parent | 251248adfab36b061eb8fdd08aa54b318462da65 (diff) | |
download | cadence-10a402f32a6d443e959b2caed187bccf161c1645.tar.gz cadence-10a402f32a6d443e959b2caed187bccf161c1645.tar.bz2 cadence-10a402f32a6d443e959b2caed187bccf161c1645.zip |
Modernized bot
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..fe12ea5 --- /dev/null +++ b/main.cpp | |||
@@ -0,0 +1,32 @@ | |||
1 | #include "cadence.h" | ||
2 | #include <iostream> | ||
3 | |||
4 | int main(int argc, char** argv) | ||
5 | { | ||
6 | std::random_device randomDevice; | ||
7 | std::mt19937 rng(randomDevice()); | ||
8 | |||
9 | if (argc != 2) | ||
10 | { | ||
11 | std::cout << "usage: cadence [configfile]" << std::endl; | ||
12 | return -1; | ||
13 | } | ||
14 | |||
15 | std::string configfile(argv[1]); | ||
16 | |||
17 | try | ||
18 | { | ||
19 | cadence bot(configfile, rng); | ||
20 | |||
21 | try | ||
22 | { | ||
23 | bot.run(); | ||
24 | } catch (const std::exception& ex) | ||
25 | { | ||
26 | std::cout << "Error running bot: " << ex.what() << std::endl; | ||
27 | } | ||
28 | } catch (const std::exception& ex) | ||
29 | { | ||
30 | std::cout << "Error initializing bot: " << ex.what() << std::endl; | ||
31 | } | ||
32 | } | ||