Manages game settings and configuration.
More...
#include <data/Settings.hpp>
|
void | Init (std::string title) |
| Initialize settings manager.
|
|
template<typename T> |
T | Read (std::string name) const |
| Read setting value of specified type.
|
|
bool | HasValue (std::string name) const |
| Check if setting exists.
|
|
template<typename T> |
void | Save (std::string name, T data) |
| Save setting value.
|
|
void | Delete (std::string name) |
| Delete saved setting.
|
|
std::string | GetConfigPath () const |
| Get path to config directory.
|
|
void | SaveToFile () const |
| Write all settings to disk.
|
|
Manages game settings and configuration.
Handles saving/loading game settings. Settings are stored in the user's config directory and persist between game sessions.
◆ Delete()
void StevEngine::Data::Settings::Delete |
( |
std::string | name | ) |
|
Delete saved setting.
- Parameters
-
name | Setting key to delete |
◆ GetConfigPath()
std::string StevEngine::Data::Settings::GetConfigPath |
( |
| ) |
const |
|
inline |
Get path to config directory.
- Returns
- Path to config directory
◆ HasValue()
bool StevEngine::Data::Settings::HasValue |
( |
std::string | name | ) |
const |
Check if setting exists.
- Parameters
-
- Returns
- true if setting exists, false otherwise
◆ Init()
void StevEngine::Data::Settings::Init |
( |
std::string | title | ) |
|
Initialize settings manager.
- Parameters
-
title | Game title used for config directory name |
◆ Read()
template<typename T>
T StevEngine::Data::Settings::Read |
( |
std::string | name | ) |
const |
|
inline |
Read setting value of specified type.
- Template Parameters
-
- Parameters
-
- Returns
- Value of type T
◆ Save()
template<typename T>
void StevEngine::Data::Settings::Save |
( |
std::string | name, |
|
|
T | data ) |
|
inline |
Save setting value.
- Template Parameters
-
- Parameters
-
name | Setting key name |
data | Value to save |
The documentation for this class was generated from the following files: