1 // AIMgr.cxx - implementation of FGAIMgr
2 // - a global management class for FlightGear generated AI traffic
4 // Written by David Luff, started March 2002.
6 // Copyright (C) 2002 David C Luff - david.luff@nottingham.ac.uk
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 /*****************************************************************
24 * WARNING - Curt has some ideas about AI traffic so anything in here
25 * may get rewritten or scrapped. Contact Curt curt@flightgear.org
26 * before spending any time or effort on this code!!!
28 ******************************************************************/
32 #include <Main/fgfs.hxx>
33 #include <Main/fg_props.hxx>
38 #include "AILocalTraffic.hxx"
49 void FGAIMgr::init() {
50 // Hard wire some local traffic for now.
51 // This is regardless of location and hence *very* ugly but it is a start.
52 FGAILocalTraffic* local_traffic = new FGAILocalTraffic;
53 local_traffic->Init();
54 ai_list.push_back(local_traffic);
57 void FGAIMgr::bind() {
60 void FGAIMgr::unbind() {
63 void FGAIMgr::update(int dt) {
64 // Traverse the list of active planes and run all their update methods
65 ai_list_itr = ai_list.begin();
66 while(ai_list_itr != ai_list.end()) {
67 (*ai_list_itr)->Update();