-void*
-FGAIManager::createAircraft( FGAIModelEntity *entity, FGAISchedule *ref) {
-
- FGAIAircraft* ai_plane = new FGAIAircraft(this, ref);
- ai_list.push_back(ai_plane);
- ++numObjects[0];
- ++numObjects[FGAIBase::otAircraft];
- if (entity->m_class == "light") {
- ai_plane->SetPerformance(&FGAIAircraft::settings[FGAIAircraft::LIGHT]);
- } else if (entity->m_class == "ww2_fighter") {
- ai_plane->SetPerformance(&FGAIAircraft::settings[FGAIAircraft::WW2_FIGHTER]);
- } else if (entity->m_class == "jet_transport") {
- ai_plane->SetPerformance(&FGAIAircraft::settings[FGAIAircraft::JET_TRANSPORT]);
- } else if (entity->m_class == "jet_fighter") {
- ai_plane->SetPerformance(&FGAIAircraft::settings[FGAIAircraft::JET_FIGHTER]);
- } else if (entity->m_class == "tanker") {
- ai_plane->SetPerformance(&FGAIAircraft::settings[FGAIAircraft::JET_TRANSPORT]);
- ai_plane->SetTanker(true);
- } else {
- ai_plane->SetPerformance(&FGAIAircraft::settings[FGAIAircraft::JET_TRANSPORT]);
- }
- ai_plane->setAcType(entity->acType);
- ai_plane->setCompany(entity->company);
- ai_plane->setHeading(entity->heading);
- ai_plane->setSpeed(entity->speed);
- ai_plane->setPath(entity->path.c_str());
- ai_plane->setAltitude(entity->altitude);
- ai_plane->setLongitude(entity->longitude);
- ai_plane->setLatitude(entity->latitude);
- ai_plane->setBank(entity->roll);
-
- if ( entity->fp ) {
- ai_plane->SetFlightPlan(entity->fp);
- }
- if (entity->repeat) {
- ai_plane->GetFlightPlan()->setRepeat(true);
- }
- ai_plane->init();
- ai_plane->bind();
- return ai_plane;
-}