]> git.mxchange.org Git - flightgear.git/blob - src/Traffic/Schedule.hxx
Durk Talsma:
[flightgear.git] / src / Traffic / Schedule.hxx
1 /* -*- Mode: C++ -*- *****************************************************
2  * Schedule.hxx
3  * Written by Durk Talsma. Started May 5, 2004
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *
20  **************************************************************************/
21
22 /**************************************************************************
23  * This file contains the definition of the class Shedule.
24  *
25  * A schedule is basically a number of scheduled flights, wich can be
26  * assigned to an AI aircraft. 
27  **************************************************************************/
28
29 #ifndef _FGSCHEDULE_HXX_
30 #define _FGSCHEDULE_HXX_
31
32
33
34 class FGAISchedule
35 {
36  private:
37   string modelPath;
38   string livery;
39   string registration;
40   bool heavy;
41   FGScheduledFlightVec flights;
42   float lat;
43   float lon; 
44   void* AIManagerRef;
45   bool firstRun;
46
47
48  public:
49   FGAISchedule();                                           // constructor
50   FGAISchedule(string, string, string, bool, FGScheduledFlightVec);  // construct & init
51   FGAISchedule(const FGAISchedule &other);             // copy constructor
52
53   ~FGAISchedule(); //destructor
54
55   void update(time_t now);
56   void next();   // forces the schedule to move on to the next flight.
57
58   time_t      getDepartureTime    () { return flights.begin()->getDepartureTime   (); };
59   FGAirport * getDepartureAirport () { return flights.begin()->getDepartureAirport(); };
60   FGAirport * getArrivalAirport   () { return flights.begin()->getArrivalAirport  (); };
61   int         getCruiseAlt        () { return flights.begin()->getCruiseAlt       (); };
62   // More member functions follow later
63
64 };
65
66 typedef vector<FGAISchedule>           ScheduleVector;
67 typedef vector<FGAISchedule>::iterator ScheduleVectorIterator;
68
69 #endif
70