Config: Remove recursive layer

This commit is contained in:
MerryMage
2017-10-29 19:17:58 +00:00
parent f612569718
commit c8f970e2b0
13 changed files with 30 additions and 139 deletions

View File

@ -67,15 +67,7 @@ Section* Layer::GetOrCreateSection(System system, const std::string& section_nam
Section* section = GetSection(system, section_name);
if (!section)
{
if (m_layer == LayerType::Meta)
{
m_sections[system].emplace_back(
std::make_unique<RecursiveSection>(m_layer, system, section_name));
}
else
{
m_sections[system].emplace_back(std::make_unique<Section>(m_layer, system, section_name));
}
m_sections[system].emplace_back(std::make_unique<Section>(m_layer, system, section_name));
section = m_sections[system].back().get();
}
return section;
@ -124,26 +116,4 @@ void Layer::ClearDirty()
[](auto& section) { section->ClearDirty(); });
});
}
RecursiveLayer::RecursiveLayer() : Layer(LayerType::Meta)
{
}
Section* RecursiveLayer::GetSection(System system, const std::string& section_name)
{
// Always queries backwards recursively, so it doesn't matter if it exists or not on this layer
return GetOrCreateSection(system, section_name);
}
Section* RecursiveLayer::GetOrCreateSection(System system, const std::string& section_name)
{
Section* section = Layer::GetSection(system, section_name);
if (!section)
{
m_sections[system].emplace_back(
std::make_unique<RecursiveSection>(m_layer, system, section_name));
section = m_sections[system].back().get();
}
return section;
}
}