45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "game/defaults.hpp"
|
|
#include "game/defines.hpp"
|
|
|
|
namespace Options {
|
|
|
|
// Opcions d'àudio
|
|
struct Audio {
|
|
bool music_enabled{Defaults::Audio::MUSIC_ENABLED};
|
|
float music_volume{Defaults::Audio::MUSIC_VOLUME};
|
|
bool sound_enabled{Defaults::Audio::SOUND_ENABLED};
|
|
float sound_volume{Defaults::Audio::SOUND_VOLUME};
|
|
float volume{Defaults::Audio::VOLUME};
|
|
};
|
|
|
|
// Opcions de finestra
|
|
struct Window {
|
|
int zoom{Defaults::Window::ZOOM};
|
|
bool fullscreen{Defaults::Window::FULLSCREEN};
|
|
};
|
|
|
|
// Opcions de joc
|
|
struct Game {
|
|
int habitacio_inicial{Defaults::Game::HABITACIO_INICIAL};
|
|
int piramide_inicial{Defaults::Game::PIRAMIDE_INICIAL};
|
|
int vides{Defaults::Game::VIDES};
|
|
};
|
|
|
|
// --- Variables globals ---
|
|
inline std::string version{};
|
|
inline Audio audio{};
|
|
inline Window window{};
|
|
inline Game game{};
|
|
inline std::string config_file_path{};
|
|
|
|
// --- API ---
|
|
void setConfigFile(const std::string& path);
|
|
auto loadFromFile() -> bool;
|
|
auto saveToFile() -> bool;
|
|
|
|
} // namespace Options
|