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