mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
Ref T171, count of aircraft supporting parts
* added functions in providers, aware class * some utility functions in aircraft list
This commit is contained in:
@@ -118,6 +118,12 @@ namespace BlackMisc
|
||||
return m_remoteAircraftProvider->isRemoteAircraftSupportingParts(callsign);
|
||||
}
|
||||
|
||||
int CRemoteAircraftAware::getRemoteAircraftSupportingPartsCount() const
|
||||
{
|
||||
Q_ASSERT_X(m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return m_remoteAircraftProvider->getRemoteAircraftSupportingPartsCount();
|
||||
}
|
||||
|
||||
bool CRemoteAircraftAware::updateAircraftEnabled(const Aviation::CCallsign &callsign, bool enabledForRedering)
|
||||
{
|
||||
Q_ASSERT_X(m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
|
||||
@@ -100,6 +100,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
virtual bool isRemoteAircraftSupportingParts(const BlackMisc::Aviation::CCallsign &callsign) const = 0;
|
||||
|
||||
//! Number of aircraft supporting parts
|
||||
//! \threadsafe
|
||||
virtual int getRemoteAircraftSupportingPartsCount() const = 0;
|
||||
|
||||
//! Remote aircraft supporting parts.
|
||||
//! \threadsafe
|
||||
virtual BlackMisc::Aviation::CCallsignSet remoteAircraftSupportingParts() const = 0;
|
||||
@@ -214,6 +218,9 @@ namespace BlackMisc
|
||||
//! \copydoc IRemoteAircraftProvider::isRemoteAircraftSupportingParts
|
||||
bool isRemoteAircraftSupportingParts(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::getRemoteAircraftSupportingPartsCount
|
||||
int getRemoteAircraftSupportingPartsCount() const;
|
||||
|
||||
//! \copydoc IRemoteAircraftProvider::updateAircraftEnabled
|
||||
bool updateAircraftEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabledForRedering);
|
||||
|
||||
|
||||
@@ -195,5 +195,35 @@ namespace BlackMisc
|
||||
this->push_back(aircraft);
|
||||
return true;
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::countEnabled() const
|
||||
{
|
||||
int c = 0;
|
||||
for (const CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.isEnabled()) { c++; }
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::countRendered() const
|
||||
{
|
||||
int c = 0;
|
||||
for (const CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.isRendered()) { c++; }
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::countAircraftPartsSyncronized() const
|
||||
{
|
||||
int c = 0;
|
||||
for (const CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.isPartsSynchronized()) { c++; }
|
||||
}
|
||||
return c;
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -100,6 +100,15 @@ namespace BlackMisc
|
||||
|
||||
//! Replace or add by callsign
|
||||
bool replaceOrAddByCallsign(const CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Number of enabled aircraft
|
||||
int countEnabled() const;
|
||||
|
||||
//! Number of rendered aircraft
|
||||
int countRendered() const;
|
||||
|
||||
//! Number of aircraft with parts
|
||||
int countAircraftPartsSyncronized() const;
|
||||
};
|
||||
} //namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user