mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T268, moved changeRemoteAircraftModel/Enabled to CSimulatorCommon and removed duplicated code
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -122,8 +122,6 @@ namespace BlackSimPlugin
|
||||
virtual bool isTimeSynchronized() const override { return false; } // TODO: Can we query the XP intrinisc feature?
|
||||
virtual bool connectTo() override;
|
||||
virtual bool disconnectFrom() override;
|
||||
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) override;
|
||||
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) override;
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual bool updateOwnSimulatorSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
|
||||
Reference in New Issue
Block a user