1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 11:53:53 +00:00
openmw/apps/opencs/model/prefs/category.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
897 B
C++
Raw Normal View History

2015-12-08 16:21:58 +00:00
#ifndef CSM_PREFS_CATEGORY_H
2015-12-06 11:06:28 +00:00
#define CSM_PREFS_CATEGORY_H
2022-10-10 11:41:36 +00:00
#include <algorithm>
2015-12-08 11:09:53 +00:00
#include <string>
#include <unordered_map>
2015-12-08 16:21:58 +00:00
#include <vector>
2015-12-06 11:06:28 +00:00
namespace CSMPrefs
{
class State;
2015-12-08 16:21:58 +00:00
class Setting;
2023-11-11 23:52:09 +00:00
class Subcategory;
2015-12-06 11:06:28 +00:00
class Category
{
2015-12-08 16:21:58 +00:00
public:
typedef std::vector<Setting*> Container;
typedef Container::iterator Iterator;
2022-09-22 18:26:05 +00:00
private:
2015-12-06 11:06:28 +00:00
State* mParent;
2015-12-08 16:21:58 +00:00
std::string mKey;
Container mSettings;
std::unordered_map<std::string, Setting*> mIndex;
2015-12-08 16:21:58 +00:00
public:
Category(State* parent, const std::string& key);
2015-12-06 11:06:28 +00:00
const std::string& getKey() const;
2015-12-08 16:21:58 +00:00
State* getState() const;
2015-12-06 11:06:28 +00:00
2015-12-08 08:56:42 +00:00
void addSetting(Setting* setting);
2015-12-06 11:06:28 +00:00
2023-11-11 23:52:09 +00:00
void addSubcategory(Subcategory* setting);
2015-12-06 11:06:28 +00:00
Iterator begin();
2015-12-08 16:21:58 +00:00
Iterator end();
Setting& operator[](const std::string& key);
2015-12-12 10:58:53 +00:00
void update();
2015-12-06 11:06:28 +00:00
};
}
#endif