Ref T182, adjust scoring in livery, ICAO codes

This commit is contained in:
Klaus Basan
2017-11-06 03:50:40 +01:00
parent 0f133f6505
commit 7db5e9aea3
3 changed files with 38 additions and 38 deletions

View File

@@ -132,8 +132,7 @@ namespace BlackMisc
int CAircraftIcaoCode::calculateScore(const CAircraftIcaoCode &otherCode) const
{
const bool bothFromDb = this->isLoadedFromDb() && otherCode.isLoadedFromDb();
if (bothFromDb && otherCode.getDbKey() == this->getDbKey()) { return 100; }
if (this->isDbEqual(otherCode)) { return 100; }
int score = 0;
if (this->hasValidDesignator() && this->getDesignator() == otherCode.getDesignator())
@@ -163,19 +162,22 @@ namespace BlackMisc
}
}
// score needs to higher than ranking
// 0..65 so far
if (this->hasManufacturer() && otherCode.hasManufacturer())
{
if (this->matchesManufacturer(otherCode.getManufacturer()))
{
score += 20;
score += 10;
}
else if (this->getManufacturer().contains(otherCode.getManufacturer(), Qt::CaseInsensitive))
{
score += 15;
score += 5;
}
}
// 0..75 so far
if (this->isMilitary() == otherCode.isMilitary()) { score += 10; }
// 0..85
return score;
}