refs #296 minor improvements in initializing and sorting CAirport and CAirportList

This commit is contained in:
Mathew Sutcliffe
2014-07-14 23:32:04 +01:00
parent 527fa8a492
commit b1ac4defdf
4 changed files with 26 additions and 0 deletions

View File

@@ -91,5 +91,18 @@ namespace BlackMisc
return airport.calculcateDistanceAndBearingToPlane(position, updateValues) > maxDistance;
});
}
/*
* Sort by range
*/
void CAirportList::sortByRange(const BlackMisc::Geo::CCoordinateGeodetic &position, bool updateValues)
{
if (updateValues)
{
this->calculcateDistanceAndBearingToPlane(position);
}
this->sort([ & ](const CAirport &a, const CAirport &b) { return a.getDistanceToPlane() < b.getDistanceToPlane(); });
}
} // namespace
} // namespace