mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 06:27:43 +00:00
Initial round of MREA cooking imps
This commit is contained in:
@@ -587,6 +587,34 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaI
|
||||
return hecl::ProjectPath();
|
||||
}
|
||||
|
||||
template <class BRIDGETYPE>
|
||||
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaId, int layerIdx, bool& activeOut) const
|
||||
{
|
||||
activeOut = false;
|
||||
if (!m_bridges)
|
||||
LogDNACommon.report(logvisor::Fatal,
|
||||
"PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()");
|
||||
auto bridgePathIt = m_bridgePaths.cbegin();
|
||||
for (const BRIDGETYPE& bridge : *m_bridges)
|
||||
{
|
||||
for (const auto& level : bridge.m_levelDeps)
|
||||
for (const auto& area : level.second.areas)
|
||||
if (area.first == areaId)
|
||||
{
|
||||
hecl::ProjectPath levelPath(bridgePathIt->first, level.second.name);
|
||||
hecl::ProjectPath areaPath(levelPath, area.second.name);
|
||||
if (layerIdx < 0)
|
||||
return areaPath;
|
||||
const typename Level<IDType>::Area::Layer& layer = area.second.layers.at(layerIdx);
|
||||
activeOut = layer.active;
|
||||
return hecl::ProjectPath(areaPath, layer.name);
|
||||
}
|
||||
++bridgePathIt;
|
||||
}
|
||||
return hecl::ProjectPath();
|
||||
}
|
||||
|
||||
|
||||
template <class BRIDGETYPE>
|
||||
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId, int layerIdx) const
|
||||
{
|
||||
@@ -611,6 +639,33 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId
|
||||
return hecl::ProjectPath();
|
||||
}
|
||||
|
||||
template <class BRIDGETYPE>
|
||||
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId, int layerIdx, bool& activeOut) const
|
||||
{
|
||||
activeOut = false;
|
||||
if (!m_bridges)
|
||||
LogDNACommon.report(logvisor::Fatal,
|
||||
"PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()");
|
||||
auto bridgePathIt = m_bridgePaths.cbegin();
|
||||
for (const BRIDGETYPE& bridge : *m_bridges)
|
||||
{
|
||||
for (const auto& level : bridge.m_levelDeps)
|
||||
for (const auto& area : level.second.areas)
|
||||
if (area.first == areaId)
|
||||
{
|
||||
hecl::ProjectPath levelPath(bridgePathIt->second, level.second.name);
|
||||
hecl::ProjectPath areaPath(levelPath, area.second.name);
|
||||
if (layerIdx < 0)
|
||||
return areaPath;
|
||||
const typename Level<IDType>::Area::Layer& layer = area.second.layers.at(layerIdx);
|
||||
activeOut = layer.active;
|
||||
return hecl::ProjectPath(areaPath, layer.name);
|
||||
}
|
||||
++bridgePathIt;
|
||||
}
|
||||
return hecl::ProjectPath();
|
||||
}
|
||||
|
||||
template class PAKRouter<DNAMP1::PAKBridge>;
|
||||
template class PAKRouter<DNAMP2::PAKBridge>;
|
||||
template class PAKRouter<DNAMP3::PAKBridge>;
|
||||
|
||||
Reference in New Issue
Block a user