mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T260, added functions for probes to CSimConnectObject
This commit is contained in:
committed by
Roland Winklmeier
parent
9fa3e415f5
commit
efac4f1f27
@@ -204,6 +204,18 @@ namespace BlackSimPlugin
|
||||
return CSimConnectObject();
|
||||
}
|
||||
|
||||
CSimConnectObject CSimConnectObjects::markObjectAsAdded(DWORD objectId)
|
||||
{
|
||||
for (const CCallsign &cs : this->keys())
|
||||
{
|
||||
CSimConnectObject &simObject = (*this)[cs];
|
||||
if (simObject.getObjectId() != objectId) { continue; }
|
||||
simObject.setConfirmedAdded(true);
|
||||
return simObject;
|
||||
}
|
||||
return CSimConnectObject();
|
||||
}
|
||||
|
||||
CSimConnectObject CSimConnectObjects::getSimObjectForRequestId(DWORD requestId) const
|
||||
{
|
||||
for (const CSimConnectObject &simObject : this->values())
|
||||
@@ -215,10 +227,17 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimConnectObjects::isKnownSimObjectId(DWORD objectId) const
|
||||
{
|
||||
const CSimConnectObject simObject(getSimObjectForObjectId(objectId));
|
||||
const CSimConnectObject simObject(this->getSimObjectForObjectId(objectId));
|
||||
return simObject.hasValidRequestAndObjectId() && objectId == simObject.getObjectId();
|
||||
}
|
||||
|
||||
bool CSimConnectObjects::removeByObjectId(DWORD objectId)
|
||||
{
|
||||
const CSimConnectObject simObject(this->getSimObjectForObjectId(objectId));
|
||||
const int c = this->remove(simObject.getCallsign());
|
||||
return c > 0;
|
||||
}
|
||||
|
||||
bool CSimConnectObjects::containsPendingAdded() const
|
||||
{
|
||||
for (const CSimConnectObject &simObject : this->values())
|
||||
@@ -257,6 +276,16 @@ namespace BlackSimPlugin
|
||||
return c;
|
||||
}
|
||||
|
||||
int CSimConnectObjects::countConfirmedAdded()
|
||||
{
|
||||
int c = 0;
|
||||
for (const CSimConnectObject &simObject : this->values())
|
||||
{
|
||||
if (simObject.isConfirmedAdded()) { c++; }
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
CCallsignSet CSimConnectObjects::getPendingAddedCallsigns() const
|
||||
{
|
||||
CCallsignSet callsigns;
|
||||
@@ -277,6 +306,25 @@ namespace BlackSimPlugin
|
||||
return callsigns;
|
||||
}
|
||||
|
||||
QList<CSimConnectObject> CSimConnectObjects::getByType(CSimConnectObject::SimObjectType type) const
|
||||
{
|
||||
QList<CSimConnectObject> objs;
|
||||
for (const CSimConnectObject &simObject : this->values())
|
||||
{
|
||||
if (simObject.getType() == type) { objs.push_back(simObject); }
|
||||
}
|
||||
return objs;
|
||||
}
|
||||
|
||||
bool CSimConnectObjects::containsType(CSimConnectObject::SimObjectType type) const
|
||||
{
|
||||
for (const CSimConnectObject &simObject : this->values())
|
||||
{
|
||||
if (simObject.getType() == type) { return true; }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CSimConnectObjects::toggleInterpolatorModes()
|
||||
{
|
||||
for (const CCallsign &cs : this->keys())
|
||||
|
||||
Reference in New Issue
Block a user