-int FGAIManager::createShip( string path, double latitude, double longitude,
- double altitude, double heading, double speed,
- double rudder ) {
-
- FGAIShip* ai_ship = new FGAIShip(this);
- ai_list.push_back(ai_ship);
- ai_ship->setID( assignID() );
- ++numObjects;
- ai_ship->setHeading(heading);
- ai_ship->setSpeed(speed);
- ai_ship->setPath(path.c_str());
- ai_ship->setAltitude(altitude);
- ai_ship->setLongitude(longitude);
- ai_ship->setLatitude(latitude);
- ai_ship->setBank(rudder);
- ai_ship->init();
- ai_ship->bind();
- return ai_ship->getID();
-}
+ for (int i = 0; i < scenarios->nChildren(); i++) {
+ SGPropertyNode* scEntry = scenarios->getChild(i);
+
+ if (strcmp(scEntry->getName(), "entry"))
+ continue;
+ std::string type = scEntry->getStringValue("type", "aircraft");
+
+ if (type == "tanker") { // refueling scenarios
+ FGAITanker* tanker = new FGAITanker;
+ tanker->readFromScenario(scEntry);
+ attach(tanker);
+
+ } else if (type == "wingman") {
+ FGAIWingman* wingman = new FGAIWingman;
+ wingman->readFromScenario(scEntry);
+ attach(wingman);
+
+ } else if (type == "aircraft") {
+ FGAIAircraft* aircraft = new FGAIAircraft;
+ aircraft->readFromScenario(scEntry);
+ attach(aircraft);
+
+ } else if (type == "ship") {
+ FGAIShip* ship = new FGAIShip;
+ ship->readFromScenario(scEntry);
+ attach(ship);
+
+ } else if (type == "carrier") {
+ FGAICarrier* carrier = new FGAICarrier;
+ carrier->readFromScenario(scEntry);
+ attach(carrier);
+
+ } else if (type == "thunderstorm") {
+ FGAIStorm* storm = new FGAIStorm;
+ storm->readFromScenario(scEntry);
+ attach(storm);
+
+ } else if (type == "thermal") {
+ FGAIThermal* thermal = new FGAIThermal;
+ thermal->readFromScenario(scEntry);
+ attach(thermal);
+
+ } else if (type == "ballistic") {
+ FGAIBallistic* ballistic = new FGAIBallistic;
+ ballistic->readFromScenario(scEntry);
+ attach(ballistic);
+
+ } else if (type == "static") {
+ FGAIStatic* aistatic = new FGAIStatic;
+ aistatic->readFromScenario(scEntry);
+ attach(aistatic);