refs #619, utility functions simulator info

This commit is contained in:
Klaus Basan
2016-03-12 05:26:48 +01:00
parent a5ad8c245b
commit 7714f5db9f
2 changed files with 20 additions and 0 deletions

View File

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