#include "LoaderStringTableT6.h" #include "Csv/CsvStream.h" #include "Game/T6/CommonT6.h" #include "Game/T6/T6.h" #include "StringTable/StringTableLoader.h" #include using namespace T6; namespace { class StringTableLoader final : public AssetCreator { public: StringTableLoader(MemoryManager& memory, ISearchPath& searchPath) : m_memory(memory), m_search_path(searchPath) { } AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override { const auto file = m_search_path.Open(assetName); if (!file.IsOpen()) return AssetCreationResult::NoAction(); string_table::StringTableLoaderV3 loader; auto* stringTable = loader.LoadFromStream(assetName, m_memory, *file.m_stream); return AssetCreationResult::Success(context.AddAsset(assetName, stringTable)); } private: MemoryManager& m_memory; ISearchPath& m_search_path; }; } // namespace namespace T6 { std::unique_ptr> CreateStringTableLoader(MemoryManager& memory, ISearchPath& searchPath) { return std::make_unique(memory, searchPath); } } // namespace T6