Index: code/branches/consolecommands3/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/consolecommands3/src/libraries/core/CMakeLists.txt	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/core/CMakeLists.txt	(revision 7207)
@@ -35,5 +35,4 @@
   OrxonoxClass.cc
   Resource.cc
-  ScopedSingletonManager.cc
   WindowEventListener.cc
 
Index: code/branches/consolecommands3/src/libraries/core/Core.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/Core.cc	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/core/Core.cc	(revision 7207)
@@ -52,4 +52,5 @@
 #include "util/Exception.h"
 #include "util/Scope.h"
+#include "util/ScopedSingletonManager.h"
 #include "util/SignalHandler.h"
 #include "PathConfig.h"
@@ -65,5 +66,4 @@
 #include "Language.h"
 #include "LuaState.h"
-#include "ScopedSingletonManager.h"
 #include "command/CommandExecutor.h"
 #include "command/IOConsole.h"
Index: code/branches/consolecommands3/src/libraries/core/ScopedSingletonManager.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/ScopedSingletonManager.cc	(revision 7205)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "ScopedSingletonManager.h"
-
-namespace orxonox
-{
-    /*static*/ std::map<std::string, ScopedSingletonManager*>& ScopedSingletonManager::getManagers()
-    {
-        static std::map<std::string, ScopedSingletonManager*> managers;
-        return managers;
-    }
-    /*static*/ ScopedSingletonManager::ManagerMultiMap& ScopedSingletonManager::getManagersByScope()
-    {
-        static ManagerMultiMap managers;
-        return managers;
-    }
-
-    /*static*/ void ScopedSingletonManager::addManager(ScopedSingletonManager* manager)
-    {
-        getManagers()[manager->className_] = manager;
-        getManagersByScope().insert(std::make_pair(manager->scope_, manager));
-    }
-}
Index: code/branches/consolecommands3/src/libraries/core/ScopedSingletonManager.h
===================================================================
--- code/branches/consolecommands3/src/libraries/core/ScopedSingletonManager.h	(revision 7205)
+++ 	(revision )
@@ -1,212 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef __ScopedSingletonManager_H__
-#define __ScopedSingletonManager_H__
-
-#include "CorePrereqs.h"
-
-#include <cassert>
-#include <map>
-#include "util/Exception.h"
-#include "util/Scope.h"
-#include "util/Singleton.h"
-
-#define ManageScopedSingleton(className, scope, allowedToFail) \
-    className* className::singletonPtr_s = NULL; \
-    static ClassScopedSingletonManager<className, scope, allowedToFail> className##ScopedSingletonManager(#className)
-
-namespace orxonox
-{
-    class _CoreExport ScopedSingletonManager
-    {
-        public:
-            ScopedSingletonManager(const std::string& className, ScopeID::Value scope)
-                : className_(className)
-                , scope_(scope)
-            { }
-            virtual ~ScopedSingletonManager() { }
-            static void addManager(ScopedSingletonManager* manager);
-
-            template<ScopeID::Value scope>
-            static void preUpdate(const Clock& time)
-            {
-                assert(Scope<scope>::isActive());
-                for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it)
-                    it->second->preUpdate(time);
-            }
-            virtual void preUpdate(const Clock& time) = 0;
-            template<ScopeID::Value scope>
-            static void postUpdate(const Clock& time)
-            {
-                assert(Scope<scope>::isActive());
-                for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it)
-                    it->second->postUpdate(time);
-            }
-            virtual void postUpdate(const Clock& time) = 0;
-
-            static std::map<std::string, ScopedSingletonManager*>& getManagers();
-            typedef std::multimap<ScopeID::Value, ScopedSingletonManager*> ManagerMultiMap;
-            static ManagerMultiMap& getManagersByScope();
-
-        protected:
-            const std::string className_;
-            const ScopeID::Value scope_;
-    };
-
-    template <class T, ScopeID::Value scope, bool allowedToFail>
-    class ClassScopedSingletonManager : public ScopedSingletonManager, public ScopeListener
-    {
-    public:
-        ClassScopedSingletonManager(const std::string& className)
-            : ScopedSingletonManager(className, scope)
-            , ScopeListener(scope)
-            , singletonPtr_(NULL)
-        {
-            ScopedSingletonManager::addManager(this);
-        }
-
-        ~ClassScopedSingletonManager()
-        {
-        }
-
-        //! Called if the Scope of the Singleton gets active (creates the instance)
-        void activated()
-        {
-            assert(singletonPtr_ == NULL);
-            singletonPtr_ = new T();
-        }
-
-        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
-        void deactivated()
-        {
-            assert(singletonPtr_ != NULL);
-            this->destroy(singletonPtr_);
-            singletonPtr_ = NULL;
-        }
-
-        void destroy(OrxonoxClass*)
-        {
-            singletonPtr_->destroy();
-        }
-        void destroy(void*)
-        {
-            delete singletonPtr_;
-        }
-
-        //! Called every frame by the ScopedSingletonManager
-        void preUpdate(const Clock& time)
-        {
-            assert(Scope<scope>::isActive());
-            // assuming T inherits Singleton<T>
-            singletonPtr_->preUpdateSingleton(time);
-        }
-
-        //! Called every frame by the ScopedSingletonManager
-        void postUpdate(const Clock& time)
-        {
-            assert(Scope<scope>::isActive());
-            // assuming T inherits Singleton<T>
-            singletonPtr_->postUpdateSingleton(time);
-        }
-
-    private:
-        T* singletonPtr_;
-    };
-
-    template <class T, ScopeID::Value scope>
-    class ClassScopedSingletonManager<T, scope, true> : public ScopedSingletonManager, public ScopeListener
-    {
-    public:
-        ClassScopedSingletonManager(const std::string& className)
-            : ScopedSingletonManager(className, scope)
-            , ScopeListener(scope)
-            , singletonPtr_(NULL)
-        {
-            ScopedSingletonManager::addManager(this);
-        }
-
-        ~ClassScopedSingletonManager()
-        {
-        }
-
-        //! Called if the Scope of the Singleton gets active (creates the instance)
-        void activated()
-        {
-            assert(singletonPtr_ == NULL);
-            try
-                { singletonPtr_ = new T(); }
-            catch (const InitialisationAbortedException& ex)
-                { COUT(3) << ex.getDescription() << std::endl; }
-            catch (...)
-                { COUT(1) << "Singleton creation failed: " << Exception::handleMessage() << std::endl; }
-        }
-
-        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
-        void deactivated()
-        {
-            if (singletonPtr_ != NULL)
-            {
-                this->destroy(singletonPtr_);
-                singletonPtr_ = NULL;
-            }
-        }
-
-        void destroy(OrxonoxClass* ptr)
-        {
-            singletonPtr_->destroy();
-        }
-        void destroy(void* ptr)
-        {
-            delete singletonPtr_;
-        }
-
-        //! Called every frame by the ScopedSingletonManager
-        void preUpdate(const Clock& time)
-        {
-            assert(Scope<scope>::isActive());
-            // assuming T inherits Singleton<T>
-            if (singletonPtr_ != NULL)
-                singletonPtr_->preUpdateSingleton(time);
-        }
-
-        //! Called every frame by the ScopedSingletonManager
-        void postUpdate(const Clock& time)
-        {
-            assert(Scope<scope>::isActive());
-            // assuming T inherits Singleton<T>
-            if (singletonPtr_ != NULL)
-                singletonPtr_->postUpdateSingleton(time);
-        }
-
-    private:
-        T* singletonPtr_;
-    };
-}
-
-#endif /* __ScopedSingletonManager_H__ */
Index: code/branches/consolecommands3/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/input/KeyBinderManager.cc	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/core/input/KeyBinderManager.cc	(revision 7207)
@@ -31,8 +31,8 @@
 #include "util/Debug.h"
 #include "util/Exception.h"
+#include "util/ScopedSingletonManager.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
 #include "core/LuaState.h"
-#include "core/ScopedSingletonManager.h"
 #include "core/command/ConsoleCommand.h"
 #include "InputManager.h"
Index: code/branches/consolecommands3/src/libraries/core/input/KeyDetector.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/input/KeyDetector.cc	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/core/input/KeyDetector.cc	(revision 7207)
@@ -29,6 +29,6 @@
 #include "KeyDetector.h"
 
+#include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
-#include "core/ScopedSingletonManager.h"
 #include "core/command/ConsoleCommand.h"
 #include "Button.h"
Index: code/branches/consolecommands3/src/libraries/network/Client.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/network/Client.cc	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/network/Client.cc	(revision 7207)
@@ -45,4 +45,5 @@
 #include "util/Clock.h"
 #include "util/Debug.h"
+#include "util/ScopedSingletonManager.h"
 #include "synchronisable/Synchronisable.h"
 #include "packet/Chat.h"
@@ -52,5 +53,4 @@
 #include "core/CommandLineParser.h"
 #include "core/Game.h"
-#include "core/ScopedSingletonManager.h"
 
 namespace orxonox
@@ -107,5 +107,5 @@
     return ClientConnection::closeConnection();
   }
-  
+
   void Client::setDestination(const std::string& serverAddress, unsigned int port)
   {
Index: code/branches/consolecommands3/src/libraries/network/LANDiscovery.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/network/LANDiscovery.cc	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/network/LANDiscovery.cc	(revision 7207)
@@ -32,12 +32,12 @@
 #include <cstring>
 
+#include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
-#include "core/ScopedSingletonManager.h"
 
 
 namespace orxonox
-{ 
+{
   ManageScopedSingleton(LANDiscovery, ScopeID::Root, true);
-  
+
   LANDiscovery::LANDiscovery()
   {
@@ -49,5 +49,5 @@
     enet_host_destroy(this->host_);
   }
-  
+
   void LANDiscovery::discover()
   {
@@ -56,8 +56,8 @@
     enet_address_set_host(&address, "255.255.255.255");
     address.port = LAN_DISCOVERY_PORT;
-    
+
     ENetPeer* peer;
     peer = enet_host_connect(this->host_, &address, 0);
-    
+
     ENetEvent event;
     while( enet_host_service(this->host_, &event, 1000 ) )
@@ -93,5 +93,5 @@
     }
   }
-  
+
   std::string LANDiscovery::getServerListItemName(unsigned int index)
   {
@@ -101,5 +101,5 @@
       return this->servers_[index].getServerName();
   }
-  
+
   std::string LANDiscovery::getServerListItemIP(unsigned int index)
   {
@@ -109,5 +109,5 @@
       return this->servers_[index].getServerIP();
   }
-  
-  
+
+
 } // namespace orxonox
Index: code/branches/consolecommands3/src/libraries/util/CMakeLists.txt
===================================================================
--- code/branches/consolecommands3/src/libraries/util/CMakeLists.txt	(revision 7205)
+++ code/branches/consolecommands3/src/libraries/util/CMakeLists.txt	(revision 7207)
@@ -31,4 +31,5 @@
   ExprParser.cc
   OutputHandler.cc
+  ScopedSingletonManager.cc
   SignalHandler.cc
   Sleep.cc
Index: code/branches/consolecommands3/src/libraries/util/ScopedSingletonManager.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/util/ScopedSingletonManager.cc	(revision 7207)
+++ code/branches/consolecommands3/src/libraries/util/ScopedSingletonManager.cc	(revision 7207)
@@ -0,0 +1,49 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ScopedSingletonManager.h"
+
+namespace orxonox
+{
+    /*static*/ std::map<std::string, ScopedSingletonManager*>& ScopedSingletonManager::getManagers()
+    {
+        static std::map<std::string, ScopedSingletonManager*> managers;
+        return managers;
+    }
+    /*static*/ ScopedSingletonManager::ManagerMultiMap& ScopedSingletonManager::getManagersByScope()
+    {
+        static ManagerMultiMap managers;
+        return managers;
+    }
+
+    /*static*/ void ScopedSingletonManager::addManager(ScopedSingletonManager* manager)
+    {
+        getManagers()[manager->className_] = manager;
+        getManagersByScope().insert(std::make_pair(manager->scope_, manager));
+    }
+}
Index: code/branches/consolecommands3/src/libraries/util/ScopedSingletonManager.h
===================================================================
--- code/branches/consolecommands3/src/libraries/util/ScopedSingletonManager.h	(revision 7207)
+++ code/branches/consolecommands3/src/libraries/util/ScopedSingletonManager.h	(revision 7207)
@@ -0,0 +1,214 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef __ScopedSingletonManager_H__
+#define __ScopedSingletonManager_H__
+
+#include "UtilPrereqs.h"
+
+#include <cassert>
+#include <map>
+#include "util/Exception.h"
+#include "util/Scope.h"
+#include "util/Singleton.h"
+
+#define ManageScopedSingleton(className, scope, allowedToFail) \
+    className* className::singletonPtr_s = NULL; \
+    static ClassScopedSingletonManager<className, scope, allowedToFail> className##ScopedSingletonManager(#className)
+
+namespace orxonox
+{
+    class OrxonoxClass;
+
+    class _UtilExport ScopedSingletonManager
+    {
+        public:
+            ScopedSingletonManager(const std::string& className, ScopeID::Value scope)
+                : className_(className)
+                , scope_(scope)
+            { }
+            virtual ~ScopedSingletonManager() { }
+            static void addManager(ScopedSingletonManager* manager);
+
+            template<ScopeID::Value scope>
+            static void preUpdate(const Clock& time)
+            {
+                assert(Scope<scope>::isActive());
+                for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it)
+                    it->second->preUpdate(time);
+            }
+            virtual void preUpdate(const Clock& time) = 0;
+            template<ScopeID::Value scope>
+            static void postUpdate(const Clock& time)
+            {
+                assert(Scope<scope>::isActive());
+                for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it)
+                    it->second->postUpdate(time);
+            }
+            virtual void postUpdate(const Clock& time) = 0;
+
+            static std::map<std::string, ScopedSingletonManager*>& getManagers();
+            typedef std::multimap<ScopeID::Value, ScopedSingletonManager*> ManagerMultiMap;
+            static ManagerMultiMap& getManagersByScope();
+
+        protected:
+            const std::string className_;
+            const ScopeID::Value scope_;
+    };
+
+    template <class T, ScopeID::Value scope, bool allowedToFail>
+    class ClassScopedSingletonManager : public ScopedSingletonManager, public ScopeListener
+    {
+    public:
+        ClassScopedSingletonManager(const std::string& className)
+            : ScopedSingletonManager(className, scope)
+            , ScopeListener(scope)
+            , singletonPtr_(NULL)
+        {
+            ScopedSingletonManager::addManager(this);
+        }
+
+        ~ClassScopedSingletonManager()
+        {
+        }
+
+        //! Called if the Scope of the Singleton gets active (creates the instance)
+        void activated()
+        {
+            assert(singletonPtr_ == NULL);
+            singletonPtr_ = new T();
+        }
+
+        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
+        void deactivated()
+        {
+            assert(singletonPtr_ != NULL);
+            this->destroy(singletonPtr_);
+            singletonPtr_ = NULL;
+        }
+
+        void destroy(OrxonoxClass*)
+        {
+            singletonPtr_->destroy();
+        }
+        void destroy(void*)
+        {
+            delete singletonPtr_;
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void preUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            singletonPtr_->preUpdateSingleton(time);
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void postUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            singletonPtr_->postUpdateSingleton(time);
+        }
+
+    private:
+        T* singletonPtr_;
+    };
+
+    template <class T, ScopeID::Value scope>
+    class ClassScopedSingletonManager<T, scope, true> : public ScopedSingletonManager, public ScopeListener
+    {
+    public:
+        ClassScopedSingletonManager(const std::string& className)
+            : ScopedSingletonManager(className, scope)
+            , ScopeListener(scope)
+            , singletonPtr_(NULL)
+        {
+            ScopedSingletonManager::addManager(this);
+        }
+
+        ~ClassScopedSingletonManager()
+        {
+        }
+
+        //! Called if the Scope of the Singleton gets active (creates the instance)
+        void activated()
+        {
+            assert(singletonPtr_ == NULL);
+            try
+                { singletonPtr_ = new T(); }
+            catch (const InitialisationAbortedException& ex)
+                { COUT(3) << ex.getDescription() << std::endl; }
+            catch (...)
+                { COUT(1) << "Singleton creation failed: " << Exception::handleMessage() << std::endl; }
+        }
+
+        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
+        void deactivated()
+        {
+            if (singletonPtr_ != NULL)
+            {
+                this->destroy(singletonPtr_);
+                singletonPtr_ = NULL;
+            }
+        }
+
+        void destroy(OrxonoxClass* ptr)
+        {
+            singletonPtr_->destroy();
+        }
+        void destroy(void* ptr)
+        {
+            delete singletonPtr_;
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void preUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            if (singletonPtr_ != NULL)
+                singletonPtr_->preUpdateSingleton(time);
+        }
+
+        //! Called every frame by the ScopedSingletonManager
+        void postUpdate(const Clock& time)
+        {
+            assert(Scope<scope>::isActive());
+            // assuming T inherits Singleton<T>
+            if (singletonPtr_ != NULL)
+                singletonPtr_->postUpdateSingleton(time);
+        }
+
+    private:
+        T* singletonPtr_;
+    };
+}
+
+#endif /* __ScopedSingletonManager_H__ */
