afegida persistencia i fuck yamal
This commit is contained in:
37
source/game/options.hpp
Normal file
37
source/game/options.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#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 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 Game game{};
|
||||
inline std::string config_file_path{};
|
||||
|
||||
// --- API ---
|
||||
void setConfigFile(const std::string& path);
|
||||
auto loadFromFile() -> bool;
|
||||
auto saveToFile() -> bool;
|
||||
|
||||
} // namespace Options
|
||||
Reference in New Issue
Block a user