-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.hpp
More file actions
74 lines (60 loc) · 1.67 KB
/
config.hpp
File metadata and controls
74 lines (60 loc) · 1.67 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef INCLUDE_ROADAGAIN_CONFIG
#define INCLUDE_ROADAGAIN_CONFIG
#include <string>
#include <argp.h>
#include "board.hpp"
#include "enemy.hpp"
namespace roadagain
{
class Config
{
public:
static Config& instance();
bool init(int argc, char** argv);
bool color() const;
bool automatic() const;
CellColor player() const;
Level level() const;
std::string log_file_name() const;
static const std::string BLACK_STR;
static const std::string WHITE_STR;
static const std::string AUTOMATIC_STR;
static const std::string AUTOMATIC_DESCRIPTION;
static const char AUTOMATIC_CHAR;
static const std::string COLOR_STR;
static const std::string COLOR_DESCRIPTION;
static const char COLOR_CHAR;
static const std::string ALWAYS_STR;
static const std::string AUTO_STR;
static const std::string NEVER_STR;
static const std::string LEVEL_STR;
static const std::string LEVEL_DESCRIPTION;
static const char LEVEL_CHAR;
static const std::string EASY_STR;
static const std::string MEDIUM_STR;
static const std::string HARD_STR;
static const std::string LOG_STR;
static const std::string LOG_DESCRIPTION;
static const char LOG_CHAR;
static const std::string ARGS_DOC;
private:
Config();
Config(const Config& config);
Config& operator=(const Config& config);
bool color_;
bool automatic_;
CellColor player_;
Level level_;
std::string log_file_name_;
};
struct arguments
{
bool automatic;
bool color;
Level level;
CellColor player;
std::string log_file_name;
};
error_t parse_opt(int key, char* arg, struct argp_state* state);
} // namespace roadagain
#endif