GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Config.hpp
Go to the documentation of this file.
1 #ifndef RADIX_CONFIG_HPP
2 #define RADIX_CONFIG_HPP
3 
4 #include <string>
5 
6 #include <json11/json11.hpp>
7 
9 using namespace json11;
10 
11 namespace radix {
12 
13 class ArgumentsParser;
14 
19 class Config {
20 friend class ArgumentsParser;
21 
22 public:
23  Config();
24  void load();
25  bool isLoaded();
26  unsigned int getWidth() { return width; }
27  unsigned int getHeight() { return height; }
28  float getSensitivity() { return sensitivity; }
29  bool isFullscreen() { return fullscreen; }
30  int getAntialiasLevel() { return antialiasing; }
31  int getRecursionLevel() { return recursivePortal; }
32  bool hasSound() { return sound; }
33  bool hasVsync() { return vsync; }
34  bool isHidePortalsByClick() { return hidePortalsByClick; }
35  bool getCursorVisibility() { return cursorVisibility; }
36  bool getIgnoreGlVersion() { return ignoreGlVersion; }
37  LogLevel getLoglevel() { return loglevel; }
38  std::string getMap() { return map; }
39  std::string getMapPath() { return mapPath; }
40 
41 private:
42  void loadVideoSettings(Json json);
43  void loadSoundSettings(Json json);
44  void loadMouseSettings(Json json);
45  void loadLoglevelSettings(Json json);
46 
47  bool loaded;
48  unsigned int width;
49  unsigned int height;
50  float sensitivity;
53  bool fullscreen;
54  bool sound;
55  bool vsync;
60  std::string map;
61  std::string mapPath;
62 };
63 
64 } /* namespace radix */
65 
66 #endif /* RADIX_CONFIG_HPP */
std::string getMap()
Definition: Config.hpp:38
bool getIgnoreGlVersion()
Definition: Config.hpp:36
bool getCursorVisibility()
Definition: Config.hpp:35
bool vsync
Definition: Config.hpp:55
unsigned int getWidth()
Definition: Config.hpp:26
bool hasVsync()
Definition: Config.hpp:33
Definition: GameController.hpp:7
unsigned int width
Definition: Config.hpp:48
int getAntialiasLevel()
Definition: Config.hpp:30
bool isFullscreen()
Definition: Config.hpp:29
std::string map
Definition: Config.hpp:60
bool cursorVisibility
Definition: Config.hpp:57
Configuration class.
Definition: Config.hpp:19
float getSensitivity()
Definition: Config.hpp:28
std::string getMapPath()
Definition: Config.hpp:39
int antialiasing
Definition: Config.hpp:51
int recursivePortal
Definition: Config.hpp:52
bool fullscreen
Definition: Config.hpp:53
unsigned int height
Definition: Config.hpp:49
Definition: ArgumentsParser.hpp:9
bool loaded
Definition: Config.hpp:47
bool isHidePortalsByClick()
Definition: Config.hpp:34
LogLevel getLoglevel()
Definition: Config.hpp:37
bool sound
Definition: Config.hpp:54
LogLevel loglevel
Definition: Config.hpp:59
std::string mapPath
Definition: Config.hpp:61
bool ignoreGlVersion
Definition: Config.hpp:58
LogLevel
Definition: Logger.hpp:8
bool hasSound()
Definition: Config.hpp:32
int getRecursionLevel()
Definition: Config.hpp:31
unsigned int getHeight()
Definition: Config.hpp:27
bool hidePortalsByClick
Definition: Config.hpp:56
float sensitivity
Definition: Config.hpp:50