Debian Codegraph @

plugins/dm.difficulty/DifficultySettingsManager.h

raw
1 #pragma once
2
3 #include "DifficultySettings.h"
4
5 namespace difficulty {
6
7 /**
8 * greebo: The DifficultyManager contains all settings of all
9 * available difficulty levels. The manager also provides
10 * methods to fill in the settings data into a given
11 * GtkTreeModel and to save the existing settings to the map/entityDef.
12 **/
13 class DifficultySettingsManager
14 {
15 // This contains all the settings of all the difficulty levels
16 std::vector<DifficultySettingsPtr> _settings;
17
18 // The names of the difficulty levels
19 std::vector<std::string> _difficultyNames;
20 std::vector<std::string> _defaultDifficultyNames;
21
22 public:
23 // Loads all settings from the entityDefs and the currently loaded map.
24 void loadSettings();
25
26 // Saves the current working set into one map entity
27 void saveSettings();
28
29 // Get the settings object for the given difficulty <level>
30 DifficultySettingsPtr getSettings(int level);
31
32 // Get the display name of the given difficulty level
33 std::string getDifficultyName(int level);
34
35 /// Set the name for the given difficulty level, and save it into the map
36 void setDifficultyName(int level, const std::string& name);
37
38 private:
39 void loadDefaultSettings();
40 void loadMapSettings();
41 void loadDifficultyNames();
42 };
43
44 } // namespace difficulty