mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T632, utility functions in client/client list
This commit is contained in:
@@ -29,5 +29,18 @@ namespace BlackMisc
|
||||
if (this->isEmpty()) { return static_cast<CClient::Capabilities>(CClient::None); }
|
||||
return this->findFirstByCallsign(callsign).getCapabilities();
|
||||
}
|
||||
|
||||
CClientList CClientList::filterPilotsByCallsign(const CCallsignSet &callsigns) const
|
||||
{
|
||||
CClientList filtered;
|
||||
for (const CClient &client : *this)
|
||||
{
|
||||
if (client.isAtc() || callsigns.contains(client.getCallsign()))
|
||||
{
|
||||
filtered.push_back(client);
|
||||
}
|
||||
}
|
||||
return filtered;
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user