--- /dev/null
+// FGAICarrier - FGAIShip-derived class creates an AI aircraft carrier
+//
+// Written by David Culp, started October 2004.
+// - davidculp2@comcast.net
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "AICarrier.hxx"
+
+
+FGAICarrier::FGAICarrier(FGAIManager* mgr) : FGAIShip(mgr) {
+}
+
+FGAICarrier::~FGAICarrier() {
+}
+
+
+void FGAICarrier::update(double dt) {
+ FGAIShip::update(dt);
+}
+
+
+
--- /dev/null
+// FGAICarrier - AIShip-derived class creates an AI aircraft carrier
+//
+// Written by David Culp, started October 2004.
+//
+// Copyright (C) 2004 David P. Culp - davidculp2@comcast.net
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#ifndef _FG_AICARRIER_HXX
+#define _FG_AICARRIER_HXX
+
+#include "AIShip.hxx"
+class FGAIManager;
+
+class FGAICarrier : public FGAIShip {
+
+public:
+
+ FGAICarrier(FGAIManager* mgr);
+ ~FGAICarrier();
+
+private:
+
+ void update(double dt);
+};
+
+#endif // _FG_AICARRIER_HXX
#include "AIBallistic.hxx"
#include "AIStorm.hxx"
#include "AIThermal.hxx"
+#include "AICarrier.hxx"
SG_USING_STD(list);
return ai_ship;
}
+void*
+FGAIManager::createCarrier( FGAIModelEntity *entity ) {
+
+ FGAIShip* ai_carrier = new FGAICarrier(this);
+ ai_list.push_back(ai_carrier);
+ ++numObjects[0];
+ ++numObjects[FGAIBase::otShip];
+ ai_carrier->setHeading(entity->heading);
+ ai_carrier->setSpeed(entity->speed);
+ ai_carrier->setPath(entity->path.c_str());
+ ai_carrier->setAltitude(entity->altitude);
+ ai_carrier->setLongitude(entity->longitude);
+ ai_carrier->setLatitude(entity->latitude);
+ ai_carrier->setBank(entity->rudder);
+
+ if ( entity->fp ) {
+ ai_carrier->setFlightPlan(entity->fp);
+ }
+
+ ai_carrier->init();
+ ai_carrier->bind();
+ return ai_carrier;
+}
+
void*
FGAIManager::createBallistic( FGAIModelEntity *entity ) {
} else if ( en->m_type == "ship") {
createShip( en );
+ } else if ( en->m_type == "carrier") {
+ createCarrier( en );
+
} else if ( en->m_type == "thunderstorm") {
createStorm( en );
void* createThermal( FGAIModelEntity *entity );
void* createStorm( FGAIModelEntity *entity );
void* createShip( FGAIModelEntity *entity );
+ void* createCarrier( FGAIModelEntity *entity );
void destroyObject( void* ID );
AIStorm.hxx AIStorm.cxx \
AIThermal.hxx AIThermal.cxx \
AIFlightPlan.hxx AIFlightPlan.cxx \
- AIScenario.hxx AIScenario.cxx
+ AIScenario.hxx AIScenario.cxx \
+ AICarrier.hxx AICarrier.cxx
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src