]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/Schedule.hxx
PLIB net removed from FlightGear
[flightgear.git] / src / Traffic / Schedule.hxx
index 4dd8d5f001a16eec3f145313ff27c106bc91cbd1..cc80e40805a2a9d9878525302d514b4f37b6bd11 100644 (file)
@@ -48,17 +48,26 @@ class FGAISchedule
   string currentDestination;
   bool heavy;
   FGScheduledFlightVec flights;
-  float lat;
-  float lon; 
+  SGGeod position;
   double radius;
   double groundOffset;
   double distanceToUser;
   int AIManagerRef;
-  //int score;
+  double score;
+  unsigned int runCount;
+  unsigned int hits;
   bool firstRun;
   double courseToDest;
-
-
+  bool initialized;
+
+  void scheduleFlights();
+  
+  /**
+   * Transition this schedule from distant mode to AI mode;
+   * create the AIAircraft (and flight plan) and register with the AIManager
+   */
+  bool createAIAircraft(FGScheduledFlight* flight, double speedKnots, time_t deptime);
+  
  public:
   FGAISchedule();                                           // constructor
   FGAISchedule(string model, 
@@ -79,7 +88,7 @@ class FGAISchedule
 
   ~FGAISchedule(); //destructor
 
-  bool update(time_t now);
+  bool update(time_t now, const SGVec3d& userCart);
   bool init();
 
   double getSpeed         ();
@@ -101,10 +110,17 @@ class FGAISchedule
   const string& getFlightRules    () { return (*flights.begin())->getFlightRules (); };
   bool getHeavy                   () { return heavy; };
   double getCourse                () { return courseToDest; };
+  unsigned int getRunCount        () { return runCount; };
+  unsigned int getHits            () { return hits; };
+
+  void         setrunCount(unsigned int count) { runCount = count; };
+  void         setHits    (unsigned int count) { hits     = count; };
+  void         setScore   ();
+  double       getScore   () { return score; };
   FGScheduledFlight*findAvailableFlight (const string &currentDestination, const string &req);
   // used to sort in decending order of score: I've probably found a better way to
   // decending order sorting, but still need to test that.
-  //bool operator< (const FGAISchedule &other) const { return (score > other.score); };
+  bool operator< (const FGAISchedule &other) const { return (score > other.score); };
   //void * getAiRef                 () { return AIManagerRef; };
   //FGAISchedule* getAddress        () { return this;};