mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
refs #619, utility functions simulator info
This commit is contained in:
@@ -66,6 +66,11 @@ namespace BlackMisc
|
||||
return fsx() || fs9() || xplane() || p3d();
|
||||
}
|
||||
|
||||
bool CSimulatorInfo::isSingleSimulator() const
|
||||
{
|
||||
return this->numberSimulators() == 1;
|
||||
}
|
||||
|
||||
bool CSimulatorInfo::isNoSimulator() const
|
||||
{
|
||||
return m_simulator == 0;
|
||||
@@ -76,6 +81,15 @@ namespace BlackMisc
|
||||
return fsx() && fs9() && xplane() && p3d();
|
||||
}
|
||||
|
||||
int CSimulatorInfo::numberSimulators() const
|
||||
{
|
||||
int c = fs9() ? 1 : 0;
|
||||
if (fsx()) { c++; }
|
||||
if (xplane()) { c++; }
|
||||
if (p3d()) { c++; }
|
||||
return c;
|
||||
}
|
||||
|
||||
bool CSimulatorInfo::matchesAll(const CSimulatorInfo &otherInfo) const
|
||||
{
|
||||
return (this->m_simulator & otherInfo.m_simulator) == otherInfo.m_simulator;
|
||||
|
||||
Reference in New Issue
Block a user