X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FTraffic%2FSchedule.hxx;h=315969042ff43e260ba9e4c1a0e04df81afeb7d3;hb=62a359cc4a338b2f8b720edf8183ab5b69710b14;hp=689524a54db2a58465c33f5617020ac5c29a35e5;hpb=b3e969726249e772da4c9d1aa6eb212e6472aed3;p=flightgear.git diff --git a/src/Traffic/Schedule.hxx b/src/Traffic/Schedule.hxx index 689524a54..315969042 100644 --- a/src/Traffic/Schedule.hxx +++ b/src/Traffic/Schedule.hxx @@ -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; + 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 ScheduleVector; -typedef vector::iterator ScheduleVectorIterator; +typedef vector ScheduleVector; +typedef vector::iterator ScheduleVectorIterator; #endif