Ref T171, count of aircraft supporting parts

* added functions in providers, aware class
* some utility functions in aircraft list
This commit is contained in:
Klaus Basan
2017-10-10 20:59:01 +02:00
parent c553d5cdfd
commit c882c64824
8 changed files with 66 additions and 0 deletions

View File

@@ -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