]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIPlane.hxx
Fix the nmea and garmin output to a) fake a GSA sentence, b) fix a y2k bug
[flightgear.git] / src / ATC / AIPlane.hxx
index 544212ee08f1be0f3ae7ad041b7034c60fc1d9b4..7f00d89a5297ac07968540cb6bf6234a56f45ddc 100644 (file)
@@ -82,12 +82,9 @@ public:
        inline PatternLeg GetLeg() {return leg;}
        
        // Return what type of landing we're doing on this circuit
-       LandingType GetLandingOption();
+       virtual LandingType GetLandingOption();
 
 protected:
-       // callback type for derived classes to use
-       typedef void (*ai_plane_callback_t) (void);
-
        PlaneRec plane;
 
     double mag_hdg;    // degrees - the heading that the physical aircraft is *pointing*
@@ -113,23 +110,26 @@ protected:
        FGATC* tuned_station;                   // and this if they are tuned to ATC
        
        // Transmit a message when channel becomes free of other dialog
-    void Transmit(ai_plane_callback_t callback = NULL);
+    void Transmit(int callback_code = 0);
        
        // Transmit a message if channel becomes free within timeout (seconds). timeout of zero implies no limit
-       void Transmit(double timeout, ai_plane_callback_t callback = NULL);
+       void ConditionalTransmit(double timeout, int callback_code = 0);
        
        // Transmit regardless of other dialog on the channel eg emergency
-       void ImmediateTransmit(ai_plane_callback_t callback = NULL);
+       void ImmediateTransmit(int callback_code = 0);
 
     void Bank(double angle);
     void LevelWings(void);
        
+       virtual void ProcessCallback(int code);
+       
        PatternLeg leg;
        
 private:
        bool _pending;
        double _timeout;
-       ai_plane_callback_t _callback;
+       int _callback_code;     // A callback code to be notified and processed by the derived classes
+                                               // A value of zero indicates no callback required
        bool _transmit;         // we are to transmit
        bool _transmitting;     // we are transmitting
        double _counter;