#ifndef RESOURCE_LOADER_H #define RESOURCE_LOADER_H #include "resource_pack.h" #include class ResourceLoader { private: static std::unique_ptr instance; ResourcePack* resourcePack; std::string packPath; bool fallbackToFiles; ResourceLoader(); public: static ResourceLoader& getInstance(); ~ResourceLoader(); bool initialize(const std::string& packFile, bool enableFallback = true); void shutdown(); std::vector loadResource(const std::string& filename); bool resourceExists(const std::string& filename); void setFallbackToFiles(bool enable) { fallbackToFiles = enable; } bool getFallbackToFiles() const { return fallbackToFiles; } size_t getLoadedResourceCount() const; std::vector getAvailableResources() const; private: std::vector loadFromFile(const std::string& filename); std::string getDataPath(const std::string& filename); }; #endif