mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
refs #296 minor improvements in initializing and sorting CAirport and CAirportList
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user