]> git.mxchange.org Git - flightgear.git/commitdiff
Converted to a simple FGSubsystemGroup.
authordavid <david>
Wed, 29 Jan 2003 16:02:46 +0000 (16:02 +0000)
committerdavid <david>
Wed, 29 Jan 2003 16:02:46 +0000 (16:02 +0000)
src/Systems/system_mgr.cxx
src/Systems/system_mgr.hxx

index 8deb5a763c39f994cdab06846e5339b8191d212b..cb7406f98a4e952a36746d92d681cd12d4f98e13 100644 (file)
 
 FGSystemMgr::FGSystemMgr ()
 {
-    // NO-OP
+    set_subsystem("electrical", new FGElectricalSystem);
+    set_subsystem("pitot", new PitotSystem);
+    set_subsystem("static", new StaticSystem);
+    set_subsystem("vacuum", new VacuumSystem);
 }
 
 FGSystemMgr::~FGSystemMgr ()
 {
-    for (unsigned int i = 0; i < _systems.size(); i++) {
-        delete _systems[i];
-        _systems[i] = 0;
-    }
-}
-
-void
-FGSystemMgr::init ()
-{
-                                // TODO: replace with XML configuration
-    _systems.push_back(new FGElectricalSystem);
-    _systems.push_back(new PitotSystem);
-    _systems.push_back(new StaticSystem);
-    _systems.push_back(new VacuumSystem);
-
-                                // Initialize the individual systems
-    for (unsigned int i = 0; i < _systems.size(); i++)
-        _systems[i]->init();
-}
-
-void
-FGSystemMgr::bind ()
-{
-    // NO-OP
-}
-
-void
-FGSystemMgr::unbind ()
-{
-    // NO-OP
-}
-
-void
-FGSystemMgr::update (double dt)
-{
-    for (unsigned int i = 0; i < _systems.size(); i++)
-        _systems[i]->update(dt);
 }
 
 // end of system_manager.cxx
index c16201424c4efccd944f492677703b819b14b7e3..544b1e30ac7f07f15bc289b60a655f467ba6f93c 100644 (file)
 
 #include <Main/fgfs.hxx>
 
-#include <vector>
-
-SG_USING_STD(vector);
-
 
 /**
  * Manage aircraft systems.
@@ -30,21 +26,12 @@ SG_USING_STD(vector);
  * In the initial draft, the systems present are hard-coded, but they
  * will soon be configurable for individual aircraft.
  */
-class FGSystemMgr : public FGSubsystem
+class FGSystemMgr : public FGSubsystemGroup
 {
 public:
 
     FGSystemMgr ();
     virtual ~FGSystemMgr ();
-
-    virtual void init ();
-    virtual void bind ();
-    virtual void unbind ();
-    virtual void update (double dt);
-
-private:
-    vector<FGSubsystem *> _systems;
-
 };
 
 #endif // __SYSTEM_MGR_HXX