mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Ref T111, utility function setEnabled
This commit is contained in:
committed by
Mathew Sutcliffe
parent
8bffc9b598
commit
2b0241a8a7
@@ -109,6 +109,19 @@ namespace BlackMisc
|
||||
return c;
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::setEnabled(const CCallsign &callsign, bool enabled, bool onlyFirst)
|
||||
{
|
||||
int c = 0;
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
aircraft.setEnabled(enabled);
|
||||
c++;
|
||||
if (onlyFirst) break;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::setAircraftModel(const CCallsign &callsign, const CAircraftModel &model, bool onlyFirst)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
@@ -80,6 +80,9 @@ namespace BlackMisc
|
||||
//! Mark given callsign as rendered
|
||||
int setRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered, bool onlyFirst = true);
|
||||
|
||||
//! Mark given callsign as enabled
|
||||
int setEnabled(const BlackMisc::Aviation::CCallsign &callsign, bool enabled, bool onlyFirst = true);
|
||||
|
||||
//! Set model
|
||||
int setAircraftModel(const BlackMisc::Aviation::CCallsign &callsign, const CAircraftModel &model, bool onlyFirst = true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user