]> git.mxchange.org Git - flightgear.git/blob - src/ATC/AIMgr.cxx
- fixed ANSI C++ namespace problems
[flightgear.git] / src / ATC / AIMgr.cxx
1 // AIMgr.cxx - implementation of FGAIMgr 
2 // - a global management class for FlightGear generated AI traffic
3 //
4 // Written by David Luff, started March 2002.
5 //
6 // Copyright (C) 2002  David C Luff - david.luff@nottingham.ac.uk
7 //
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.
12 //
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.
17 //
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.
21
22 /*****************************************************************
23 *
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!!!
27 *
28 ******************************************************************/
29
30
31
32 #include <Main/fgfs.hxx>
33 #include <Main/fg_props.hxx>
34
35 #include <list>
36
37 #include "AIMgr.hxx"
38 #include "AILocalTraffic.hxx"
39
40 SG_USING_STD(list);
41
42
43 FGAIMgr::FGAIMgr() {
44 }
45
46 FGAIMgr::~FGAIMgr() {
47 }
48
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);
55 }
56
57 void FGAIMgr::bind() {
58 }
59
60 void FGAIMgr::unbind() {
61 }
62
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();
68         ++ai_list_itr;
69     }
70 }