1
0
Fork 0

Airways: findEnroute by Positioned

Avoid any ambiguity with naming from the string version
This commit is contained in:
James Turner 2022-01-12 22:06:33 +01:00
parent 9a08d9fcd6
commit bc09d5e64d
2 changed files with 16 additions and 0 deletions

View file

@ -398,6 +398,21 @@ WayptRef Airway::findEnroute(const std::string &aIdent) const
return {}; return {};
} }
WayptRef Airway::findEnroute(const FGPositionedRef& nav) const
{
loadWaypoints();
auto it = std::find_if(_elements.begin(), _elements.end(),
[&nav](WayptRef w)
{
if (!w) return false;
return w->source() == nav;
});
if (it != _elements.end())
return *it;
return {};
}
void Airway::Network::addEdge(int aWay, const SGGeod& aStartPos, void Airway::Network::addEdge(int aWay, const SGGeod& aStartPos,
const std::string& aStartIdent, const std::string& aStartIdent,
const SGGeod& aEndPos, const std::string& aEndIdent) const SGGeod& aEndPos, const std::string& aEndIdent)

View file

@ -90,6 +90,7 @@ public:
bool containsNavaid(const FGPositionedRef& navaid) const; bool containsNavaid(const FGPositionedRef& navaid) const;
WayptRef findEnroute(const FGPositionedRef& navaid) const;
/** /**