2002-09-23 19:55:10 +00:00
|
|
|
// system_mgr.cxx - manage aircraft systems.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#include "system_mgr.hxx"
|
2002-09-24 15:24:04 +00:00
|
|
|
#include "electrical.hxx"
|
2002-09-24 14:51:37 +00:00
|
|
|
#include "vacuum.hxx"
|
2002-09-23 19:55:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
FGSystemMgr::FGSystemMgr ()
|
|
|
|
{
|
|
|
|
// NO-OP
|
|
|
|
}
|
|
|
|
|
|
|
|
FGSystemMgr::~FGSystemMgr ()
|
|
|
|
{
|
2002-09-24 13:07:30 +00:00
|
|
|
for (unsigned int i = 0; i < _systems.size(); i++) {
|
2002-09-23 19:55:10 +00:00
|
|
|
delete _systems[i];
|
|
|
|
_systems[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGSystemMgr::init ()
|
|
|
|
{
|
|
|
|
// TODO: replace with XML configuration
|
2002-09-24 15:24:04 +00:00
|
|
|
_systems.push_back(new ElectricalSystem);
|
2002-09-23 19:55:10 +00:00
|
|
|
_systems.push_back(new VacuumSystem);
|
|
|
|
|
|
|
|
// Initialize the individual systems
|
2002-09-24 13:07:30 +00:00
|
|
|
for (unsigned int i = 0; i < _systems.size(); i++)
|
2002-09-23 19:55:10 +00:00
|
|
|
_systems[i]->init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGSystemMgr::bind ()
|
|
|
|
{
|
|
|
|
// NO-OP
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGSystemMgr::unbind ()
|
|
|
|
{
|
|
|
|
// NO-OP
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FGSystemMgr::update (double dt)
|
|
|
|
{
|
2002-09-24 13:07:30 +00:00
|
|
|
for (unsigned int i = 0; i < _systems.size(); i++)
|
2002-09-23 19:55:10 +00:00
|
|
|
_systems[i]->update(dt);
|
|
|
|
}
|
|
|
|
|
|
|
|
// end of system_manager.cxx
|