1 // AIManager.hxx - experimental! - David Culp - based on:
2 // AIMgr.hxx - definition of FGAIMgr
3 // - a global management class for FlightGear generated AI traffic
5 // Written by David Luff, started March 2002.
7 // Copyright (C) 2002 David C Luff - david.luff@nottingham.ac.uk
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _FG_AIMANAGER_HXX
24 #define _FG_AIMANAGER_HXX
28 #include <simgear/structure/subsystem_mgr.hxx>
30 #include <Main/fg_props.hxx>
32 #include <AIModel/AIBase.hxx>
33 #include <AIModel/AIScenario.hxx>
34 #include <AIModel/AIFlightPlan.hxx>
40 class FGAIManager : public SGSubsystem
45 // A list of pointers to AI objects
46 typedef list <FGAIBase*> ai_list_type;
47 typedef ai_list_type::iterator ai_list_iterator;
48 typedef ai_list_type::const_iterator ai_list_const_iterator;
50 // Everything put in this list should be created dynamically
51 // on the heap and ***DELETED WHEN REMOVED!!!!!***
53 ai_list_iterator ai_list_itr;
63 void update(double dt);
65 void* createBallistic( FGAIModelEntity *entity );
66 void* createAircraft( FGAIModelEntity *entity );
67 void* createThermal( FGAIModelEntity *entity );
68 void* createStorm( FGAIModelEntity *entity );
69 void* createShip( FGAIModelEntity *entity );
71 void destroyObject( void* ID );
73 inline double get_user_latitude() { return user_latitude; }
74 inline double get_user_longitude() { return user_longitude; }
75 inline double get_user_altitude() { return user_altitude; }
76 inline double get_user_heading() { return user_heading; }
77 inline double get_user_pitch() { return user_pitch; }
78 inline double get_user_yaw() { return user_yaw; }
79 inline double get_user_speed() {return user_speed; }
81 inline int getNum( FGAIBase::object_type ot ) { return numObjects[ot]; }
83 void processScenario( string filename );
89 int numObjects[FGAIBase::MAX_OBJECTS];
91 SGPropertyNode* wind_from_down_node;
92 string scenario_filename;
95 double user_longitude;
103 void fetchUserState( void );
106 double range_nearest;
108 void processThermal( FGAIThermal* thermal );
112 #endif // _FG_AIMANAGER_HXX