Airways: findEnroute by Positioned
Avoid any ambiguity with naming from the string version
This commit is contained in:
parent
9a08d9fcd6
commit
bc09d5e64d
2 changed files with 16 additions and 0 deletions
|
@ -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)
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
|
|
||||||
bool containsNavaid(const FGPositionedRef& navaid) const;
|
bool containsNavaid(const FGPositionedRef& navaid) const;
|
||||||
|
|
||||||
|
WayptRef findEnroute(const FGPositionedRef& navaid) const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue