#pragma once #include "utility/BinaryStream.hpp" #include #include #include #include #include namespace fs = std::filesystem; namespace parser { class MpqManager { private: using HANDLE = void*; bool Alpha; fs::path BasePath; std::unordered_map MpqHandles; std::unordered_map Maps; std::unordered_map AreaToZone; void LoadMpq(const std::filesystem::path& filePath); public: void Initialize(); void Initialize(const fs::path& wowDir); bool FileExists(const std::string& file) const; std::unique_ptr OpenFile(const std::string& file); unsigned int GetMapId(const std::string& name) const; unsigned int GetZoneId(unsigned int areaId) const; }; extern thread_local MpqManager sMpqManager; }; // namespace parser