]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIShip.hxx
Optimise NavCache airport query
[flightgear.git] / src / AIModel / AIShip.hxx
index e7bda357044546f3d53f51fb962709be296a1a43..009b735f58311f92944ee7d0c03d9832e2dc52c6 100644 (file)
@@ -39,10 +39,10 @@ public:
 
     virtual bool init(bool search_in_AI_path=false);
     virtual void bind();
-    virtual void unbind();
     virtual void update(double dt);
+    virtual void reinit();
+
     void setFlightPlan(FGAIFlightPlan* f);
-//    void setName(const string&);
     void setRudder(float r);
     void setRoll(double rl);
     void ProcessFlightPlan( double dt);
@@ -52,20 +52,23 @@ public:
     void YawTo(double angle);
     void ClimbTo(double altitude);
     void TurnTo(double heading);
-    void setCurrName(const string&);
-    void setNextName(const string&);
-    void setPrevName(const string&);
+    void setCurrName(const std::string&);
+    void setNextName(const std::string&);
+    void setPrevName(const std::string&);
     void setLeadAngleGain(double g);
     void setLeadAngleLimit(double l);
     void setLeadAngleProp(double p);
     void setRudderConstant(double rc);
     void setSpeedConstant(double sc);
     void setFixedTurnRadius(double ft);
+    void setRollFactor(double rf);
+
     void setTunnel(bool t);
     void setInitialTunnel(bool t);
 
     void setWPNames();
     void setWPPos();
+
     double sign(double x);
 
     bool _hdg_lock;
@@ -81,40 +84,33 @@ public:
     double _missed_range, _tow_angle, _wait_count, _missed_count,_wp_range;
     double _dt_count, _next_run;
 
-    FGAIFlightPlan::waypoint* prev; // the one behind you
-    FGAIFlightPlan::waypoint* curr; // the one ahead
-    FGAIFlightPlan::waypoint* next; // the next plus 1
+    FGAIWaypoint* prev; // the one behind you
+    FGAIWaypoint* curr; // the one ahead
+    FGAIWaypoint* next; // the next plus 1
 
 protected:
 
-//    string _name; // The name of this ship.
-
 private:
 
 
-
-    virtual void reinit() { init(); }
-
     void setRepeat(bool r);
     void setRestart(bool r);
     void setMissed(bool m);
 
     void setServiceable(bool s);
     void Run(double dt);
-    void setStartTime(const string&);
-    void setUntilTime(const string&);
+    void setStartTime(const std::string&);
+    void setUntilTime(const std::string&);
     //void setWPPos();
     void setWPAlt();
     void setXTrackError();
 
     SGGeod wppos;
 
-    const SGMaterial* _material;
-
     double getRange(double lat, double lon, double lat2, double lon2) const;
     double getCourse(double lat, double lon, double lat2, double lon2) const;
     double getDaySeconds();
-    double processTimeString(const string& time);
+    double processTimeString(const std::string& time);
 
     bool initFlightPlan();
     bool advanceFlightPlan (double elapsed_sec, double day_sec);
@@ -133,9 +129,9 @@ private:
     double _xtrack_error;
     double _curr_alt, _prev_alt;
 
-    string _prev_name, _curr_name, _next_name;
-    string _path;
-    string _start_time, _until_time;
+    std::string _prev_name, _curr_name, _next_name;
+    std::string _path;
+    std::string _start_time, _until_time;
 
     bool _repeat;
     bool _fp_init;