Ref T268, moved changeRemoteAircraftModel/Enabled to CSimulatorCommon and removed duplicated code

This commit is contained in:
Klaus Basan
2018-06-06 17:56:56 +02:00
parent de4c7852a6
commit 0f931eeeb3
7 changed files with 28 additions and 51 deletions

View File

@@ -577,28 +577,6 @@ namespace BlackSimPlugin
return this->getAircraftInRange().findByRendered(true).getCallsigns(); // just a poor workaround
}
bool CSimulatorXPlane::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft)
{
// remove upfront, and then enable / disable again
auto callsign = aircraft.getCallsign();
if (!this->isPhysicallyRenderedAircraft(callsign)) { return false; }
this->physicallyRemoveRemoteAircraft(callsign);
return this->changeRemoteAircraftEnabled(aircraft);
}
bool CSimulatorXPlane::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft)
{
if (aircraft.isEnabled())
{
this->physicallyAddRemoteAircraft(aircraft);
}
else
{
this->physicallyRemoveRemoteAircraft(aircraft.getCallsign());
}
return true;
}
bool CSimulatorXPlane::followAircraft(const CCallsign &callsign)
{
if (! m_trafficProxy || ! m_trafficProxy->isValid()) { return false; }