]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/FlightPlan.hxx
Reduce severity of a failure to create a marker beacon due to an unknown runway from...
[flightgear.git] / src / Navaids / FlightPlan.hxx
index b46dae03c7a11230b2bd8f8b2713dc592642a421..78dc7e6ab4f88bf389afdd117a417959b655f361 100644 (file)
@@ -100,7 +100,7 @@ public:
   {
   public:
     virtual ~Delegate();
-    
+        
     virtual void departureChanged() { }
     virtual void arrivalChanged() { }
     virtual void waypointsChanged() { }
@@ -120,6 +120,7 @@ public:
     
     friend class FlightPlan;
     
+    bool _deleteWithPlan;
     Delegate* _inner;
   };
   
@@ -207,9 +208,30 @@ public:
    */
   WayptRef waypointFromString(const std::string& target);
   
-  void setDelegate(Delegate* d);
+  /**
+   * abstract interface for creating delegates automatically when a
+   * flight-plan is created or loaded
+   */
+  class DelegateFactory
+  {
+  public:
+    virtual Delegate* createFlightPlanDelegate(FlightPlan* fp) = 0;
+  };
+  
+  static void registerDelegateFactory(DelegateFactory* df);
+  static void unregisterDelegateFactory(DelegateFactory* df);
+  
+  void addDelegate(Delegate* d);
   void removeDelegate(Delegate* d);
 private:
+  void lockDelegate();
+  void unlockDelegate();
+  
+  int _delegateLock;
+  bool _arrivalChanged, 
+    _departureChanged, 
+    _waypointsChanged, 
+    _currentWaypointChanged;
   
   bool loadPlainTextRoute(const SGPath& path);