#ifndef RESOURCE_PACK_H #define RESOURCE_PACK_H #include #include #include #include struct ResourceEntry { std::string filename; uint64_t offset; uint64_t size; uint32_t checksum; }; class ResourcePack { private: std::unordered_map resources; std::vector data; bool loaded; uint32_t calculateChecksum(const std::vector& data); void encryptData(std::vector& data, const std::string& key); void decryptData(std::vector& data, const std::string& key); public: ResourcePack(); ~ResourcePack(); bool loadPack(const std::string& packFile); bool savePack(const std::string& packFile); bool addFile(const std::string& filename, const std::string& filepath); bool addDirectory(const std::string& directory); std::vector getResource(const std::string& filename); bool hasResource(const std::string& filename) const; void clear(); size_t getResourceCount() const; std::vector getResourceList() const; static const std::string DEFAULT_ENCRYPT_KEY; }; #endif