]> git.mxchange.org Git - flightgear.git/blob - src/Systems/system_mgr.cxx
8deb5a763c39f994cdab06846e5339b8191d212b
[flightgear.git] / src / Systems / system_mgr.cxx
1 // system_mgr.cxx - manage aircraft systems.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain and comes with no warranty.
5
6
7 #include "system_mgr.hxx"
8 #include "electrical.hxx"
9 #include "pitot.hxx"
10 #include "static.hxx"
11 #include "vacuum.hxx"
12
13
14 FGSystemMgr::FGSystemMgr ()
15 {
16     // NO-OP
17 }
18
19 FGSystemMgr::~FGSystemMgr ()
20 {
21     for (unsigned int i = 0; i < _systems.size(); i++) {
22         delete _systems[i];
23         _systems[i] = 0;
24     }
25 }
26
27 void
28 FGSystemMgr::init ()
29 {
30                                 // TODO: replace with XML configuration
31     _systems.push_back(new FGElectricalSystem);
32     _systems.push_back(new PitotSystem);
33     _systems.push_back(new StaticSystem);
34     _systems.push_back(new VacuumSystem);
35
36                                 // Initialize the individual systems
37     for (unsigned int i = 0; i < _systems.size(); i++)
38         _systems[i]->init();
39 }
40
41 void
42 FGSystemMgr::bind ()
43 {
44     // NO-OP
45 }
46
47 void
48 FGSystemMgr::unbind ()
49 {
50     // NO-OP
51 }
52
53 void
54 FGSystemMgr::update (double dt)
55 {
56     for (unsigned int i = 0; i < _systems.size(); i++)
57         _systems[i]->update(dt);
58 }
59
60 // end of system_manager.cxx