mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "aircraftmodel.h"
|
||||
#include "distributor.h"
|
||||
#include "distributorlist.h"
|
||||
#include "blackmisc/datastoreutility.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
#include <QString>
|
||||
@@ -276,6 +276,25 @@ namespace BlackMisc
|
||||
return this->m_livery.hasValidAirlineDesignator();
|
||||
}
|
||||
|
||||
bool CAircraftModel::hasDistributor() const
|
||||
{
|
||||
return this->m_distributor.hasValidDbKey();
|
||||
}
|
||||
|
||||
bool CAircraftModel::matchesDistributor(const CDistributor &distributor) const
|
||||
{
|
||||
if (!distributor.hasValidDbKey()) { return false; }
|
||||
if (!this->hasDistributor()) { return false; }
|
||||
return this->m_distributor.getDbKey() == distributor.getDbKey();
|
||||
}
|
||||
|
||||
bool CAircraftModel::matchesAnyDistributor(const CDistributorList &distributors) const
|
||||
{
|
||||
if (distributors.isEmpty()) { return false; }
|
||||
if (!this->hasDistributor()) { return false; }
|
||||
return distributors.matchesAnyKeyOrAlias(this->m_distributor.getDbKey());
|
||||
}
|
||||
|
||||
const CIcon &CAircraftModel::getModelModeAsIcon() const
|
||||
{
|
||||
switch (this->getModelMode())
|
||||
|
||||
Reference in New Issue
Block a user