implement set block sequence

This commit is contained in:
Jan
2021-02-19 20:44:46 +01:00
parent 48e3738c05
commit 0cafabc44e
7 changed files with 48 additions and 7 deletions

View File

@ -61,7 +61,9 @@ void InMemoryRepository::Add(std::unique_ptr<StructureInformation> structureInfo
void InMemoryRepository::Add(std::unique_ptr<FastFileBlock> fastFileBlock)
{
m_fast_file_blocks.push_back(fastFileBlock.release());
auto* raw = fastFileBlock.release();
m_fast_file_blocks.push_back(raw);
m_fast_file_blocks_by_name[raw->m_name] = raw;
}
const std::string& InMemoryRepository::GetGameName() const
@ -143,3 +145,13 @@ EnumMember* InMemoryRepository::GetEnumMemberByName(const std::string& name) con
return nullptr;
}
FastFileBlock* InMemoryRepository::GetFastFileBlockByName(const std::string& name) const
{
const auto foundEntry = m_fast_file_blocks_by_name.find(name);
if (foundEntry != m_fast_file_blocks_by_name.end())
return foundEntry->second;
return nullptr;
}