]> git.mxchange.org Git - flightgear.git/blob - src/Systems/system_mgr.cxx
f30f88f711941eccea1f851d6c2e943e9ac58f60
[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 "static.hxx"
10 #include "vacuum.hxx"
11
12
13 FGSystemMgr::FGSystemMgr ()
14 {
15     // NO-OP
16 }
17
18 FGSystemMgr::~FGSystemMgr ()
19 {
20     for (unsigned int i = 0; i < _systems.size(); i++) {
21         delete _systems[i];
22         _systems[i] = 0;
23     }
24 }
25
26 void
27 FGSystemMgr::init ()
28 {
29                                 // TODO: replace with XML configuration
30     _systems.push_back(new FGElectricalSystem);
31     _systems.push_back(new StaticSystem);
32     _systems.push_back(new VacuumSystem);
33
34                                 // Initialize the individual systems
35     for (unsigned int i = 0; i < _systems.size(); i++)
36         _systems[i]->init();
37 }
38
39 void
40 FGSystemMgr::bind ()
41 {
42     // NO-OP
43 }
44
45 void
46 FGSystemMgr::unbind ()
47 {
48     // NO-OP
49 }
50
51 void
52 FGSystemMgr::update (double dt)
53 {
54     for (unsigned int i = 0; i < _systems.size(); i++)
55         _systems[i]->update(dt);
56 }
57
58 // end of system_manager.cxx