]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIManager.hxx
Make the scenarios work again.
[flightgear.git] / src / AIModel / AIManager.hxx
index 449b03b409221d3c1d39d0f93eab33c2042355b0..fd3357f5bb23ac8bf099614ea463777fff897e9f 100644 (file)
 #ifndef _FG_AIMANAGER_HXX
 #define _FG_AIMANAGER_HXX
 
+#include <list>
+
 #include <simgear/structure/subsystem_mgr.hxx>
+
 #include <Main/fg_props.hxx>
-#include <list>
-#include "AIBase.hxx"
-#include "AIScenario.hxx"
-#include "AIFlightPlan.hxx"
+
+#include <AIModel/AIBase.hxx>
+#include <AIModel/AIScenario.hxx>
+#include <AIModel/AIFlightPlan.hxx>
 
 SG_USING_STD(list);
 class FGAIThermal;
@@ -49,11 +52,6 @@ private:
     ai_list_type ai_list;
     ai_list_iterator ai_list_itr;
 
-    // array of already-assigned ID's
-    typedef vector <int> id_vector_type;
-    id_vector_type ids;                    
-    id_vector_type::iterator id_itr;
-
 public:
 
     FGAIManager();
@@ -64,53 +62,13 @@ public:
     void unbind();
     void update(double dt);
 
-    int assignID();
-    void freeID(int ID);
-
-    int createAircraft( string model_class, // see FGAIAircraft.hxx for possible classes
-                        string path,        // path to exterior model
-                        double latitude,    // in degrees -90 to 90
-                        double longitude,   // in degrees -180 to 180
-                        double altitude,    // in feet
-                        double heading,     // true heading in degrees
-                        double speed,       // in knots true airspeed (KTAS)    
-                        double pitch = 0,   // in degrees
-                        double roll = 0 );  // in degrees
-
-    int createAircraft( string model_class, // see FGAIAircraft.hxx for possible classes
-                        string path,        // path to exterior model
-                        FGAIFlightPlan *flightplan );
-
-    int createShip(     string path,        // path to exterior model
-                        double latitude,    // in degrees -90 to 90
-                        double longitude,   // in degrees -180 to 180
-                        double altitude,    // in feet  (ex. for a lake!)
-                        double heading,     // true heading in degrees
-                        double speed,       // in knots true
-                        double rudder );    // in degrees (between 0 and 5 works best)
-
-
-    int createBallistic( string path,       // path to exterior model
-                         double latitude,   // in degrees -90 to 90
-                         double longitude,  // in degrees -180 to 180
-                         double altitude,   // in feet
-                         double azimuth,    // in degrees (same as heading)
-                         double elevation,  // in degrees (same as pitch)
-                         double speed );    // in feet per second
-
-    int createStorm( string path,        // path to exterior model
-                     double latitude,    // in degrees -90 to 90
-                     double longitude,   // in degrees -180 to 180
-                     double altitude,    // in feet
-                     double heading,     // true heading in degrees
-                     double speed );     // in knots true airspeed (KTAS)    
-
-    int createThermal( double latitude,    // in degrees -90 to 90
-                       double longitude,   // in degrees -180 to 180
-                       double strength,    // in feet per second
-                       double diameter );  // in feet
-                 
-    void destroyObject( int ID );
+    void* createBallistic( FGAIModelEntity *entity );
+    void* createAircraft( FGAIModelEntity *entity );
+    void* createThermal( FGAIModelEntity *entity );
+    void* createStorm( FGAIModelEntity *entity );
+    void* createShip( FGAIModelEntity *entity );
+
+    void destroyObject( void* ID );
 
     inline double get_user_latitude() { return user_latitude; }
     inline double get_user_longitude() { return user_longitude; }
@@ -120,15 +78,17 @@ public:
     inline double get_user_yaw() { return user_yaw; }
     inline double get_user_speed() {return user_speed; }
 
+    inline int getNum( FGAIBase::object_type ot ) { return numObjects[ot]; }
+
     void processScenario( string filename );
 
 private:
 
     bool initDone;
     bool enabled;
-    int numObjects;
+    int numObjects[FGAIBase::MAX_OBJECTS];
     SGPropertyNode* root;
-    SGPropertyNode* wind_from_down;
+    SGPropertyNode* wind_from_down_node;
     string scenario_filename;
 
     double user_latitude;