]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIFlightPlan.hxx
commradio: improvements for atis speech
[flightgear.git] / src / AIModel / AIFlightPlan.hxx
index 5b5586af1a1b36f352964dc7d0dcc34fbb6d4b3d..ff3ff2ceffc2bac9cb581e446db3af527bbeadc9 100644 (file)
 #include <simgear/compiler.h>
 #include <simgear/math/SGMath.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
-
-// forward decls
-class FGTaxiRoute;
-class FGRunway;
-class FGAIAircraft;
-class FGAirport;
-
-typedef SGSharedPtr<FGAirport> FGAirportRef;
+#include <Navaids/positioned.hxx>
+#include <Airports/dynamics.hxx>
 
 class FGAIWaypoint {
 private:
@@ -52,7 +46,7 @@ private:
 public:
     FGAIWaypoint();
     ~FGAIWaypoint() {};
-    void setName        (std::string nam) { name        = nam; };
+    void setName        (const std::string& nam) { name        = nam; };
     void setLatitude    (double lat);
     void setLongitude   (double lon);
     void setAltitude    (double alt);
@@ -66,11 +60,11 @@ public:
     void setRouteIndex  (int    rte) { routeIndex  = rte; };
     void setTime_sec    (double ts ) { time_sec    = ts;  };
     void setTrackLength (double tl ) { trackLength = tl;  };
-    void setTime        (std::string tme) { time        = tme; };
+    void setTime        (const std::string& tme) { time        = tme; };
 
-    bool contains(std::string name);
+    bool contains(const std::string& name);
 
-    std::string getName  () { return name;        };
+    const std::string& getName() { return name;        };
     const SGGeod& getPos () { return pos;         };
     double getLatitude   ();
     double getLongitude  ();
@@ -85,7 +79,7 @@ public:
     bool   isFinished    () { return finished;    };
     double getTime_sec   () { return time_sec;    };
     double getTrackLength() { return trackLength; };
-    std::string getTime  () { return time;        };
+    const std::string& getTime  () { return time;        };
 
   };
 
@@ -128,7 +122,7 @@ public:
    double getBearing(FGAIWaypoint* previous, FGAIWaypoint* next) const;
    double getBearing(const SGGeod& aPos, FGAIWaypoint* next) const;
   
-   double checkTrackLength(std::string wptName);
+   double checkTrackLength(const std::string& wptName) const;
   time_t getStartTime() const { return start_time; }
    time_t getArrivalTime() const { return arrivalTime; }
 
@@ -139,8 +133,7 @@ public:
 
   void setLeg(int val) { leg = val;}
   void setTime(time_t st) { start_time = st; }
-  int getGate() const { return gateId; }
-  void setGate(int id) { gateId = id; };
+
 
   double getLeadInAngle() const { return leadInAngle; }
   const std::string& getRunway() const;
@@ -149,21 +142,21 @@ public:
   bool getRepeat(void) const { return repeat; }
   void restart(void);
   int getNrOfWayPoints() { return waypoints.size(); }
-  int getRouteIndex(int i); // returns the AI related index of this current routes. 
-  FGTaxiRoute *getTaxiRoute() { return taxiRoute; }
-  void deleteTaxiRoute();
-  std::string getRunway() { return activeRunway; }
+
+  int getRouteIndex(int i); // returns the AI related index of this current routes.
+
+  const std::string& getRunway() { return activeRunway; }
   bool isActive(time_t time) {return time >= this->getStartTime();}
 
   void incrementLeg() { leg++;};
 
-  void setRunway(std::string rwy) { activeRunway = rwy; };
-  std::string getRunwayClassFromTrafficType(std::string fltType);
+  void setRunway(const std::string& rwy) { activeRunway = rwy; };
+  const char* getRunwayClassFromTrafficType(const std::string& fltType);
 
   void addWaypoint(FGAIWaypoint* wpt) { waypoints.push_back(wpt); };
 
-  void setName(std::string n) { name = n; };
-  std::string getName() { return name; };
+  void setName(const std::string& n) { name = n; };
+  const std::string& getName() { return name; };
 
   void setSID(FGAIFlightPlan* fp) { sid = fp;};
   FGAIFlightPlan* getSID() { return sid; };
@@ -172,6 +165,11 @@ public:
   
   void shortenToFirst(unsigned int number, std::string name);
 
+  void setGate(const ParkingAssignment& pka);
+  FGParking* getParkingGate();
+
+    FGAirportRef departureAirport() const;
+    FGAirportRef arrivalAirport() const;
 private:
   FGAIFlightPlan *sid;
   typedef std::vector <FGAIWaypoint*> wpt_vector_type;
@@ -188,9 +186,9 @@ private:
   time_t start_time;
   time_t arrivalTime;       // For AI/ATC purposes.
   int leg;
-  int gateId, lastNodeVisited;
+  ParkingAssignment gate;
+  PositionedID lastNodeVisited;
   std::string activeRunway;
-  FGTaxiRoute *taxiRoute;
   std::string name;
   bool isValid;
   FGAirportRef departure, arrival;