mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
refs #619, utility functions simulator info
This commit is contained in:
@@ -66,6 +66,11 @@ namespace BlackMisc
|
|||||||
return fsx() || fs9() || xplane() || p3d();
|
return fsx() || fs9() || xplane() || p3d();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSimulatorInfo::isSingleSimulator() const
|
||||||
|
{
|
||||||
|
return this->numberSimulators() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
bool CSimulatorInfo::isNoSimulator() const
|
bool CSimulatorInfo::isNoSimulator() const
|
||||||
{
|
{
|
||||||
return m_simulator == 0;
|
return m_simulator == 0;
|
||||||
@@ -76,6 +81,15 @@ namespace BlackMisc
|
|||||||
return fsx() && fs9() && xplane() && p3d();
|
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
|
bool CSimulatorInfo::matchesAll(const CSimulatorInfo &otherInfo) const
|
||||||
{
|
{
|
||||||
return (this->m_simulator & otherInfo.m_simulator) == otherInfo.m_simulator;
|
return (this->m_simulator & otherInfo.m_simulator) == otherInfo.m_simulator;
|
||||||
|
|||||||
@@ -80,12 +80,18 @@ namespace BlackMisc
|
|||||||
//! Any simulator?
|
//! Any simulator?
|
||||||
bool isAnySimulator() const;
|
bool isAnySimulator() const;
|
||||||
|
|
||||||
|
//! Single simulator selected
|
||||||
|
bool isSingleSimulator() const;
|
||||||
|
|
||||||
//! No simulator?
|
//! No simulator?
|
||||||
bool isNoSimulator() const;
|
bool isNoSimulator() const;
|
||||||
|
|
||||||
//! Is all simulators?
|
//! Is all simulators?
|
||||||
bool isAllSimulators() const;
|
bool isAllSimulators() const;
|
||||||
|
|
||||||
|
//! Number simulators selected
|
||||||
|
int numberSimulators() const;
|
||||||
|
|
||||||
//! Matches all simulators
|
//! Matches all simulators
|
||||||
bool matchesAll(const CSimulatorInfo &otherInfo) const;
|
bool matchesAll(const CSimulatorInfo &otherInfo) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user