afegida persistencia i fuck yamal

This commit is contained in:
2026-04-04 13:00:02 +02:00
parent 08ba88ec05
commit 6a09d7219d
9 changed files with 15021 additions and 98 deletions

37
source/game/options.hpp Normal file
View 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