mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #820, utility functions for score and groupBy
This commit is contained in:
@@ -528,6 +528,18 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
ScoredModels CAircraftModelList::scoreFull(const CAircraftModel &remoteModel, bool ignoreZeroScores) const
|
||||
{
|
||||
ScoredModels scoreMap;
|
||||
for (const CAircraftModel &model : *this)
|
||||
{
|
||||
const int score = model.calculateScore(remoteModel);
|
||||
if (ignoreZeroScores && score < 1) { continue; }
|
||||
scoreMap.insertMulti(score, model);
|
||||
}
|
||||
return scoreMap;
|
||||
}
|
||||
|
||||
QStringList CAircraftModelList::toCompleterStrings(bool sorted) const
|
||||
{
|
||||
QStringList c;
|
||||
|
||||
Reference in New Issue
Block a user