]> git.mxchange.org Git - flightgear.git/blob - src/ATC/AIMgr.hxx
More stuff to make the AI/ATC system less hardwired and more generic. Most of the...
[flightgear.git] / src / ATC / AIMgr.hxx
1 // AIMgr.hxx - definition of FGAIMgr 
2 // - a global management class for FlightGear generated AI traffic
3 //
4 // Written by David Luff, started March 2002.
5 //
6 // Copyright (C) 2002  David C Luff - david.luff@nottingham.ac.uk
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 #ifndef _FG_AIMGR_HXX
23 #define _FG_AIMGR_HXX
24
25 #include <Main/fgfs.hxx>
26 #include <Main/fg_props.hxx>
27
28 #include <list>
29
30 #include "ATCMgr.hxx"
31 #include "AIEntity.hxx"
32
33 SG_USING_STD(list);
34
35
36 class FGAIMgr : public FGSubsystem
37 {
38
39 private:
40         FGATCMgr* ATC;  
41         // This is purely for synactic convienience to avoid writing globals->get_ATC_mgr()-> all through the code!
42
43     // A list of pointers to all currently active AI stuff
44     typedef list <FGAIEntity*> ai_list_type;
45     typedef ai_list_type::iterator ai_list_iterator;
46     typedef ai_list_type::const_iterator ai_list_const_iterator;
47
48     // Everything put in this list should be created dynamically
49     // on the heap and ***DELETED WHEN REMOVED!!!!!***
50     ai_list_type ai_list;
51     ai_list_iterator ai_list_itr;
52     // Any member function of FGATCMgr is permitted to leave this iterator pointing
53     // at any point in or at the end of the list.
54     // Hence any new access must explicitly first check for atc_list.end() before dereferencing.
55         
56         // A map of airport-IDs that have taxiway network files against bucket number
57         typedef map < int, string > ai_apt_map_type;
58         typedef ai_apt_map_type::iterator ai_apt_map_iterator;
59         ai_apt_map_type airports;
60
61     // Position of the Users Aircraft
62     // (This may be needed to calculate the distance from the user when deciding which 3D model to render)
63     double current_lon;
64     double current_lat;
65     double current_elev;
66     // Pointers to current users position
67     SGPropertyNode *current_lon_node;
68     SGPropertyNode *current_lat_node;
69     SGPropertyNode *current_elev_node;
70
71     //FGATIS atis;
72     //FGGround ground;
73     //FGTower tower;
74     //FGApproach approach;
75     //FGDeparture departure;
76
77 public:
78
79     FGAIMgr();
80     ~FGAIMgr();
81
82     void init();
83
84     void bind();
85
86     void unbind();
87
88     void update(double dt);
89
90 private:
91
92     // Remove a class from the ai_list and delete it from memory
93     //void RemoveFromList(const char* id, atc_type tp);
94
95 };
96
97 #endif  // _FG_AIMGR_HXX