#pragma once #include #include #include #include #include #include #include namespace ESLoader { class TESFile { public: TESFile() = default; TESFile(TiltedPhoques::Map& aMasterFiles); void Setup(uint8_t aStandardId); void Setup(uint16_t aLiteId); bool LoadFile(const std::filesystem::path& acPath) noexcept; bool IndexRecords(RecordCollection& aRecordCollection) noexcept; [[nodiscard]] static uint32_t GetFormIdPrefix(uint32_t aFormId, TiltedPhoques::Map& aParentToFormIdPrefix) noexcept; private: bool ReadGroupOrRecord(Buffer::Reader& aReader, RecordCollection& aRecordCollection) noexcept; template T CopyAndParseRecord(Record* pRecordHeader); template void ParseGRUP(Record* pRecordHeader, T& aRecord); String m_filename = ""; Buffer m_buffer{}; union { uint8_t m_standardId = 0; uint16_t m_liteId; }; uint32_t m_formIdPrefix = 0; TiltedPhoques::Map& m_masterFiles; TiltedPhoques::Map m_parentToFormIdPrefix{}; }; } // namespace ESLoader