mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Ref T515, logic for "isLikely" simulator list moved to model list
This commit is contained in:
committed by
Mat Sutcliffe
parent
11daf3b418
commit
77e642d42d
@@ -557,6 +557,34 @@ namespace BlackMisc
|
||||
return CSimulatorInfo(s);
|
||||
}
|
||||
|
||||
namespace Private
|
||||
{
|
||||
bool isLikelyImpl(double count, double total)
|
||||
{
|
||||
if (total < 1) { return false; }
|
||||
const double fsRatio = count / total;
|
||||
return fsRatio > 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
bool CAircraftModelList::isLikelyFsFamilyModelList() const
|
||||
{
|
||||
if (this->isEmpty()) { return false; } // avoid DIV 0
|
||||
return Private::isLikelyImpl(this->countPerSimulator().getCountForFsFamilySimulators(), this->size());
|
||||
}
|
||||
|
||||
bool CAircraftModelList::isLikelyFsxFamilyModelList() const
|
||||
{
|
||||
if (this->isEmpty()) { return false; } // avoid DIV 0
|
||||
return Private::isLikelyImpl(this->countPerSimulator().getCountForFsxFamilySimulators(), this->size());
|
||||
}
|
||||
|
||||
bool CAircraftModelList::isLikelyXplaneModelList() const
|
||||
{
|
||||
if (this->isEmpty()) { return false; } // avoid DIV 0
|
||||
return Private::isLikelyImpl(this->countPerSimulator().getCount(CSimulatorInfo::xplane()), this->size());
|
||||
}
|
||||
|
||||
int CAircraftModelList::setModelMode(CAircraftModel::ModelMode mode)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
Reference in New Issue
Block a user