mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
refs #879, added ctor for CSimulatedAircraft / CPropertyIndexVariantMap::size()
This commit is contained in:
committed by
Mathew Sutcliffe
parent
9b56c5bf51
commit
5bea0e2a96
@@ -53,7 +53,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (this->isEmpty()) return QString("{wildcard: %1}").arg(this->m_wildcard ? "true" : "false");
|
if (this->isEmpty()) return QString("{wildcard: %1}").arg(this->m_wildcard ? "true" : "false");
|
||||||
QString s;
|
QString s;
|
||||||
foreach(CPropertyIndex index, this->m_values.keys())
|
foreach (CPropertyIndex index, this->m_values.keys())
|
||||||
{
|
{
|
||||||
CVariant v = this->m_values.value(index);
|
CVariant v = this->m_values.value(index);
|
||||||
|
|
||||||
@@ -120,6 +120,11 @@ namespace BlackMisc
|
|||||||
return CPropertyIndexList::fromImpl(this->m_values.keys());
|
return CPropertyIndexList::fromImpl(this->m_values.keys());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CPropertyIndexVariantMap::size() const
|
||||||
|
{
|
||||||
|
return this->m_values.size();
|
||||||
|
}
|
||||||
|
|
||||||
uint CPropertyIndexVariantMap::getValueHash() const
|
uint CPropertyIndexVariantMap::getValueHash() const
|
||||||
{
|
{
|
||||||
// there is no hash for map, so I use this workaround here
|
// there is no hash for map, so I use this workaround here
|
||||||
|
|||||||
@@ -169,6 +169,9 @@ namespace BlackMisc
|
|||||||
//! clear
|
//! clear
|
||||||
void clear() { this->m_values.clear(); }
|
void clear() { this->m_values.clear(); }
|
||||||
|
|
||||||
|
//! Number of elements
|
||||||
|
int size() const;
|
||||||
|
|
||||||
//! Equal operator, required if maps are directly compared, not with CValueObject
|
//! Equal operator, required if maps are directly compared, not with CValueObject
|
||||||
BLACKMISC_EXPORT friend bool operator ==(const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b);
|
BLACKMISC_EXPORT friend bool operator ==(const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b);
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,13 @@ namespace BlackMisc
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CSimulatedAircraft::CSimulatedAircraft(const CCallsign &callsign, const CAircraftModel &model, const CUser &user, const CAircraftSituation &situation) :
|
||||||
|
m_callsign(callsign), m_pilot(user), m_situation(situation)
|
||||||
|
{
|
||||||
|
this->setModel(model);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
void CSimulatedAircraft::init()
|
void CSimulatedAircraft::init()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_models.size() == 2, Q_FUNC_INFO, "Wrong model size");
|
Q_ASSERT_X(m_models.size() == 2, Q_FUNC_INFO, "Wrong model size");
|
||||||
|
|||||||
@@ -100,6 +100,9 @@ namespace BlackMisc
|
|||||||
//! Constructor.
|
//! Constructor.
|
||||||
CSimulatedAircraft(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Network::CUser &user, const BlackMisc::Aviation::CAircraftSituation &situation);
|
CSimulatedAircraft(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Network::CUser &user, const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||||
|
|
||||||
|
//! Constructor.
|
||||||
|
CSimulatedAircraft(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::Network::CUser &user, const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||||
|
|
||||||
//! Get callsign.
|
//! Get callsign.
|
||||||
const BlackMisc::Aviation::CCallsign &getCallsign() const { return m_callsign; }
|
const BlackMisc::Aviation::CCallsign &getCallsign() const { return m_callsign; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user