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