55 lines
1.3 KiB
C
55 lines
1.3 KiB
C
|
#ifndef PARAMETERS_H
|
||
|
#define PARAMETERS_H
|
||
|
|
||
|
#include <optional>
|
||
|
#include <iostream>
|
||
|
#include <fstream>
|
||
|
#include <sstream>
|
||
|
#include <variant>
|
||
|
#include <string>
|
||
|
#include <map>
|
||
|
|
||
|
using ParameterValue = std::variant<float, int, bool, std::string>;
|
||
|
|
||
|
class Parameters {
|
||
|
public:
|
||
|
Parameters();
|
||
|
~Parameters();
|
||
|
|
||
|
void SaveAudioParameters();
|
||
|
void SaveGraphicParameters();
|
||
|
void SaveGameParameters();
|
||
|
|
||
|
void LoadAudioParameters();
|
||
|
void LoadGraphicParameters();
|
||
|
void LoadGameParameters();
|
||
|
|
||
|
void SetAudioParameter(const std::string& key, const ParameterValue& value);
|
||
|
void SetGraphicParameter(const std::string& key, const ParameterValue& value);
|
||
|
void SetGameParameter(const std::string& key, const ParameterValue& value);
|
||
|
|
||
|
std::optional<ParameterValue> GetAudioParameter(const std::string& key) const;
|
||
|
std::optional<ParameterValue> GetGraphicParameter(const std::string& key) const;
|
||
|
std::optional<ParameterValue> GetGameParameter(const std::string& key) const;
|
||
|
|
||
|
private:
|
||
|
std::map<std::string, ParameterValue> m_audioSettings;
|
||
|
std::map<std::string, ParameterValue> m_graphicSettings;
|
||
|
std::map<std::string, ParameterValue> m_gameplaySettings;
|
||
|
|
||
|
// Audio
|
||
|
float m_mainVolume;
|
||
|
float m_musicVolume;
|
||
|
float m_sfxVolume;
|
||
|
|
||
|
// Graphic
|
||
|
float m_resolutionX;
|
||
|
float m_resolutionY;
|
||
|
bool m_fullscreen;
|
||
|
|
||
|
// Gameplay
|
||
|
float m_mouseSensitivity;
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // PARAMETERS_H
|