]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/Schedule.hxx
Alex Romosan:
[flightgear.git] / src / Traffic / Schedule.hxx
index 0664e36be4a9cf3c6158b05b9b98df28246e85c4..315969042ff43e260ba9e4c1a0e04df81afeb7d3 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _FGSCHEDULE_HXX_
 #define _FGSCHEDULE_HXX_
 
+#define TRAFFICTOAIDIST 150.0
+
 
 class FGAISchedule
 {
@@ -36,27 +38,56 @@ class FGAISchedule
   string modelPath;
   string livery;
   string registration;
+  string airline;
+  string acType;
+  string m_class;
+  string flightType;
   bool heavy;
   FGScheduledFlightVec flights;
   float lat;
   float lon; 
-  void* AIManagerRef;
+  double radius;
+  double groundOffset;
+  double distanceToUser;
+  int AIManagerRef;
   bool firstRun;
 
+
  public:
   FGAISchedule();                                           // constructor
-  FGAISchedule(string, string, string, bool, FGScheduledFlightVec);  // construct & init
+  FGAISchedule(string, string, string, bool, string, string, string, string, double, double, FGScheduledFlightVec);  // construct & init
   FGAISchedule(const FGAISchedule &other);             // copy constructor
 
   ~FGAISchedule(); //destructor
 
-  void update(time_t now);
+  bool update(time_t now);
+  bool init();
+
+  double getSpeed         ();
+  void setClosestDistanceToUser();
+  void next();   // forces the schedule to move on to the next flight.
+
+  time_t      getDepartureTime    () { return flights.begin()->getDepartureTime   (); };
+  FGAirport * getDepartureAirport () { return flights.begin()->getDepartureAirport(); };
+  FGAirport * getArrivalAirport   () { return flights.begin()->getArrivalAirport  (); };
+  int         getCruiseAlt        () { return flights.begin()->getCruiseAlt       (); };
+  double      getRadius           () { return radius; };
+  double      getGroundOffset     () { return groundOffset;};
+  const string& getFlightType     () { return flightType;};
+  const string& getAirline        () { return airline; };
+  const string& getAircraft       () { return acType; };
+  const string& getCallSign       () { return flights.begin()->getCallSign (); };
+  const string& getRegistration   () { return registration;};
+  bool getHeavy                   () { return heavy; };
+  bool operator< (const FGAISchedule &other) const { return (distanceToUser < other.distanceToUser); };
+  //void * getAiRef                 () { return AIManagerRef; };
+  //FGAISchedule* getAddress        () { return this;};
   // More member functions follow later
 
 };
 
-typedef vector<FGAISchedule>           ScheduleVector;
-typedef vector<FGAISchedule>::iterator ScheduleVectorIterator;
+typedef vector<FGAISchedule >           ScheduleVector;
+typedef vector<FGAISchedule >::iterator ScheduleVectorIterator;
 
 #endif