Ref T632, use rendered and callsign as tie breaker if distance is equal in snapshot

This commit is contained in:
Klaus Basan
2019-04-23 17:48:12 +02:00
parent 303e8b0f88
commit 8fe23b780f
4 changed files with 22 additions and 9 deletions

View File

@@ -266,5 +266,15 @@ namespace BlackMisc
}
return c;
}
void CSimulatedAircraftList::sortByDistanceToReferencePositionRenderedCallsign()
{
this->sort([ & ](const CSimulatedAircraft & a, const CSimulatedAircraft & b)
{
if (a.getRelativeDistance() != b.getRelativeDistance()) { return a.getRelativeDistance() < b.getRelativeDistance(); }
if (a.isRendered() != b.isRendered()) { return a.isRendered(); } // get the rendered first
return a.getCallsignAsString() < b.getCallsignAsString();
});
}
} // namespace
} // namespace