class PropertyWatcher;
class FGAirport;
+class FGRunway;
+
typedef SGSharedPtr<FGAirport> FGAirportRef;
/**
flightgear::Waypt* wayptAtIndex(int index) const;
+ SGPropertyNode_ptr wayptNodeAtIndex(int index) const;
+
/**
* Find a waypoint in the route, by position, and return its index, or
* -1 if no matching waypoint was found in the route.
*/
void jumpToIndex(int index);
- void saveRoute();
- void loadRoute();
+ bool saveRoute(const SGPath& p);
+ bool loadRoute(const SGPath& p);
/**
* Helper command to setup current airport/runway if necessary
*/
void initAtPosition();
+
+ /**
+ * Create a WayPoint from a string in the following format:
+ * - simple identifier
+ * - decimal-lon,decimal-lat
+ * - airport-id/runway-id
+ * - navaid/radial-deg/offset-nm
+ */
+ flightgear::WayptRef waypointFromString(const std::string& target);
+
+ FGAirportRef departureAirport() const;
+ FGAirportRef destinationAirport() const;
+
+ FGRunway* departureRunway() const;
+ FGRunway* destinationRunway() const;
private:
flightgear::WayptVec _route;
int _currentIndex;
SGPropertyNode_ptr weightOnWheels;
InputListener *listener;
- SGPropertyNode_ptr mirror;
-
- /**
- * Create a SGWayPoint from a string in the following format:
- * - simple identifier
- * - decimal-lon,decimal-lat
- * - airport-id/runway-id
- * - navaid/radial-deg/offset-nm
- */
- flightgear::WayptRef waypointFromString(const std::string& target);
-
+ SGPropertyNode_ptr mirror;
void departureChanged();
void buildDeparture(flightgear::WayptRef enroute, flightgear::WayptVec& wps);
bool checkFinished();
- void loadPlainTextRoute(const SGPath& path);
+ bool loadPlainTextRoute(const SGPath& path);
void loadVersion1XMLRoute(SGPropertyNode_ptr routeData);
void loadVersion2XMLRoute(SGPropertyNode_ptr routeData);