layout de TITOL

This commit is contained in:
2025-12-17 11:32:37 +01:00
parent 886ec8ab1d
commit 3b432e6580
45 changed files with 880 additions and 745 deletions
+28 -28
View File
@@ -4,50 +4,50 @@
#pragma once
#include "resource_pack.hpp"
#include <memory>
#include <string>
#include <vector>
#include "resource_pack.hpp"
namespace Resource {
// Singleton per gestionar la càrrega de recursos
class Loader {
public:
// Singleton
static Loader& get();
public:
// Singleton
static Loader& get();
// Inicialització
bool initialize(const std::string& pack_file, bool enable_fallback);
// Inicialització
bool initialize(const std::string& pack_file, bool enable_fallback);
// Càrrega de recursos
std::vector<uint8_t> loadResource(const std::string& filename);
bool resourceExists(const std::string& filename);
// Càrrega de recursos
std::vector<uint8_t> loadResource(const std::string& filename);
bool resourceExists(const std::string& filename);
// Validació
bool validatePack();
bool isPackLoaded() const;
// Validació
bool validatePack();
bool isPackLoaded() const;
// Estat
void setBasePath(const std::string& path);
std::string getBasePath() const;
// Estat
void setBasePath(const std::string& path);
std::string getBasePath() const;
private:
Loader() = default;
~Loader() = default;
private:
Loader() = default;
~Loader() = default;
// No es pot copiar ni moure
Loader(const Loader&) = delete;
Loader& operator=(const Loader&) = delete;
// No es pot copiar ni moure
Loader(const Loader&) = delete;
Loader& operator=(const Loader&) = delete;
// Dades
std::unique_ptr<Pack> pack_;
bool fallback_enabled_ = false;
std::string base_path_;
// Dades
std::unique_ptr<Pack> pack_;
bool fallback_enabled_ = false;
std::string base_path_;
// Funcions auxiliars
std::vector<uint8_t> loadFromFilesystem(const std::string& filename);
// Funcions auxiliars
std::vector<uint8_t> loadFromFilesystem(const std::string& filename);
};
} // namespace Resource