#pragma once #include #include #include #include #include class ResourcePack; class ResourceLoader { private: static std::unique_ptr instance; ResourcePack* resource_pack_; std::string pack_path_; bool fallback_to_files_; ResourceLoader(); public: static ResourceLoader& getInstance(); ~ResourceLoader(); bool initialize(const std::string& pack_file, bool enable_fallback = true); void shutdown(); std::vector loadResource(const std::string& filename); bool resourceExists(const std::string& filename); void setFallbackToFiles(bool enable) { fallback_to_files_ = enable; } bool getFallbackToFiles() const { return fallback_to_files_; } size_t getLoadedResourceCount() const; std::vector getAvailableResources() const; private: static std::vector loadFromFile(const std::string& filename); static std::string getDataPath(const std::string& filename); };