]> git.mxchange.org Git - flightgear.git/commitdiff
Moved PatternLeg from AILocalTraffic to AIPlane
authordaveluff <daveluff>
Tue, 15 Apr 2003 22:54:11 +0000 (22:54 +0000)
committerdaveluff <daveluff>
Tue, 15 Apr 2003 22:54:11 +0000 (22:54 +0000)
src/ATC/AILocalTraffic.hxx
src/ATC/AIPlane.cxx
src/ATC/AIPlane.hxx

index d6be8f4e599b9e29c6311b7ef088cc50bc67015e..a5297e85ea04138e9b83c6d9215a4dc7610cf9e7 100644 (file)
 #include <string>
 SG_USING_STD(string);
 
-enum PatternLeg {
-       TAKEOFF_ROLL,
-       CLIMBOUT,
-       TURN1,
-       CROSSWIND,
-       TURN2,
-       DOWNWIND,
-       TURN3,
-       BASE,
-       TURN4,
-       FINAL,
-       LANDING_ROLL
-};
-
 enum TaxiState {
        TD_INBOUND,
        TD_OUTBOUND,
@@ -94,7 +80,7 @@ public:
        void RegisterTransmission(int code); 
        
        // This is a hack and will probably go eventually
-       inline bool AtHoldShort() {return(holdingShort);}
+       inline bool AtHoldShort() {return holdingShort;}
        
 protected:
        
@@ -156,7 +142,7 @@ private:
        int numInPattern;               // Number of planes in the pattern (this might get more complicated if high performance GA aircraft fly a higher pattern eventually)
        int numAhead;           // More importantly - how many of them are ahead of us?
        double distToNext;              // And even more importantly, how near are we getting to the one immediately ahead?
-       PatternLeg leg;         // Out current position in the pattern
+       //PatternLeg leg;               // Our current position in the pattern - now moved to FGAIPlane
        StartofDescent SoD;             // Start of descent calculated wrt wind, pattern size & altitude, glideslope etc
 
        // Taxiing details
index 7802dc4ce1e1c9e925d5bcd49bd3e8ffc5ea2bee..407d09a13494feb950ccac60fb8a2f2414593bd9 100644 (file)
@@ -30,6 +30,10 @@ SG_USING_STD(string);
 #include "AIPlane.hxx"
 #include "ATCdisplay.hxx"
 
+FGAIPlane::FGAIPlane() {
+       leg = LEG_UNKNOWN;
+}
+
 FGAIPlane::~FGAIPlane() {
 }
 
index 941aab766e26838cbad0c7f919867b7a54d405c0..34e8544b011c45cae0c4cb598794773f2f1daafa 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-/*****************************************************************
-*
-* WARNING - Curt has some ideas about AI traffic so anything in here
-* may get rewritten or scrapped.  Contact Curt curt@flightgear.org 
-* before spending any time or effort on this code!!!
-*
-******************************************************************/
-
 #ifndef _FG_AI_PLANE_HXX
 #define _FG_AI_PLANE_HXX
 
 #include "AIEntity.hxx"
 #include "ATC.hxx"
 
+enum PatternLeg {
+       TAKEOFF_ROLL,
+       CLIMBOUT,
+       TURN1,
+       CROSSWIND,
+       TURN2,
+       DOWNWIND,
+       TURN3,
+       BASE,
+       TURN4,
+       FINAL,
+       LANDING_ROLL,
+       LEG_UNKNOWN
+};
 
 /*****************************************************************
 *
@@ -51,6 +57,7 @@ class FGAIPlane : public FGAIEntity {
 
 public:
 
+       FGAIPlane();
     virtual ~FGAIPlane();
 
     // Run the internal calculations
@@ -59,6 +66,9 @@ public:
        // Send a transmission *TO* the AIPlane.
        // FIXME int code is a hack - eventually this will receive Alexander's coded messages.
        virtual void RegisterTransmission(int code);
+       
+       // Return the current pattern leg the plane is flying.
+       inline PatternLeg GetLeg() {return leg;}
 
 protected:
        PlaneRec plane;
@@ -86,6 +96,8 @@ protected:
 
     void Bank(double angle);
     void LevelWings(void);
+       
+       PatternLeg leg;
 };
 
 #endif  // _FG_AI_PLANE_HXX