66#include < QSize>
77#include < QObject>
88
9+ #include " Settings.hpp"
10+
911#define PROGRAM_CONSTANTS ProgramConstants::Instance
1012
1113enum class GameObjectTypes
@@ -26,10 +28,9 @@ enum class Languages
2628class ProgramConstants
2729{
2830private: // Data
29- QSet<Qt::Key> keys = {};
30- bool console = false ;
31+ std::unique_ptr<Settings> SettingsFile = nullptr ;
3132public:
32- inline static std::unique_ptr<ProgramConstants> Instance;
33+ inline static std::unique_ptr<ProgramConstants> Instance = nullptr ;
3334
3435 // Folders
3536 const QString RESOURCE_FOLDER = " Resources" ;
@@ -79,6 +80,13 @@ class ProgramConstants
7980 const QVector<QString> USA_SHORT_NAMES = {" USA" , " SWG" , " AIR" , " LSR" };
8081 const QVector<QString> PRC_SHORT_NAMES = {" PRC" , " TNK" , " INF" , " NUK" };
8182
83+ const QSet<Qt::Key> DEFAULT_ALLOWED_KEYS =
84+ {
85+ Qt::Key_R, Qt::Key_T, Qt::Key_Y, Qt::Key_U, Qt::Key_O, Qt::Key_I, Qt::Key_P,
86+ Qt::Key_A, Qt::Key_S, Qt::Key_D, Qt::Key_F, Qt::Key_G, Qt::Key_H, Qt::Key_J, Qt::Key_K, Qt::Key_L,
87+ Qt::Key_Z, Qt::Key_X, Qt::Key_C, Qt::Key_V, Qt::Key_B, Qt::Key_N, Qt::Key_M
88+ };
89+
8290 const QMap<QChar, Qt::Key> KEYBOARD_KEYS =
8391 {
8492 {' Q' , Qt::Key_Q}, {' W' , Qt::Key_W}, {' E' , Qt::Key_E}, {' R' , Qt::Key_R}, {' T' , Qt::Key_T}, {' Y' , Qt::Key_Y}, {' U' , Qt::Key_U}, {' I' , Qt::Key_I}, {' O' , Qt::Key_O}, {' P' , Qt::Key_P},
@@ -92,7 +100,6 @@ class ProgramConstants
92100 {Languages::Russian, {" ru" , " Русский" }}
93101 };
94102
95-
96103 const QMap<GameObjectTypes, QString> INGAME_ENTITIES_STRINGS =
97104 {
98105 {GameObjectTypes::Buildings, QObject::tr (" Buildings" )},
@@ -104,9 +111,9 @@ class ProgramConstants
104111public: // Methods
105112 ProgramConstants ();
106113 // / @brief Parse `Resource\Settings.json`.
107- void InitializeSettingsJSON ();
114+ void InitializeFileSettings ();
108115 // / @brief Returns `QSet` of available keys from `QWEWRTY` keyboard to choice by user.
109- const QSet<Qt::Key>& GetAllowedKeys ();
116+ const QSet<Qt::Key> GetAllowedKeys ();
110117 // / @brief Returns field status for console from settings file.
111- bool IsConsoleEnabled ();
118+ const bool IsConsoleEnabled ();
112119};
0 commit comments