Index: code/branches/resource/src/orxonox/CameraManager.cc
===================================================================
--- code/branches/resource/src/orxonox/CameraManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/CameraManager.cc	(revision 3366)
@@ -42,12 +42,9 @@
 namespace orxonox
 {
-    CameraManager* CameraManager::singletonRef_s = 0;
+    CameraManager* CameraManager::singletonPtr_s = 0;
 
     CameraManager::CameraManager(Ogre::Viewport* viewport)
         : viewport_(viewport)
     {
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
-
         this->fallbackCamera_ = 0;
     }
@@ -55,7 +52,4 @@
     CameraManager::~CameraManager()
     {
-        assert(singletonRef_s != 0);
-        singletonRef_s = 0;
-
         if (this->fallbackCamera_)
             this->fallbackCamera_->getSceneManager()->destroyCamera(this->fallbackCamera_);
Index: code/branches/resource/src/orxonox/CameraManager.h
===================================================================
--- code/branches/resource/src/orxonox/CameraManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/CameraManager.h	(revision 3366)
@@ -41,9 +41,11 @@
 #include <list>
 #include "util/OgreForwardRefs.h"
+#include "util/Singleton.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport CameraManager
+    class _OrxonoxExport CameraManager : public Singleton<CameraManager>
     {
+            friend class Singleton<CameraManager>;
         public:
             CameraManager(Ogre::Viewport* viewport);
@@ -57,6 +59,5 @@
             void useCamera(Ogre::Camera* camera);
 
-            static CameraManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
-            static CameraManager* getInstancePtr() { return singletonRef_s; }
+            static CameraManager* getInstancePtr() { return singletonPtr_s; }
 
         private:
@@ -67,5 +68,5 @@
             Ogre::Camera*         fallbackCamera_;
 
-            static CameraManager* singletonRef_s;
+            static CameraManager* singletonPtr_s;
     };
 }
Index: code/branches/resource/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/resource/src/orxonox/LevelManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/LevelManager.cc	(revision 3366)
@@ -45,11 +45,8 @@
     SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
 
-    LevelManager* LevelManager::singletonRef_s = 0;
+    LevelManager* LevelManager::singletonPtr_s = 0;
 
     LevelManager::LevelManager()
     {
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
-
         RegisterRootObject(LevelManager);
         this->setConfigValues();
@@ -64,6 +61,4 @@
     LevelManager::~LevelManager()
     {
-        assert(singletonRef_s != 0);
-        singletonRef_s = 0;
     }
 
Index: code/branches/resource/src/orxonox/LevelManager.h
===================================================================
--- code/branches/resource/src/orxonox/LevelManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/LevelManager.h	(revision 3366)
@@ -35,4 +35,6 @@
 #include <list>
 #include <string>
+
+#include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 
@@ -42,6 +44,7 @@
     class _OrxonoxExport LevelManager
     // tolua_end
-        : public OrxonoxClass
+        : public Singleton<LevelManager>, public OrxonoxClass
     { // tolua_export
+            friend class Singleton<LevelManager>;
         public:
             LevelManager();
@@ -59,6 +62,6 @@
             std::string getAvailableLevelListItem(unsigned int index) const; //tolua_export
 
-            static LevelManager* getInstancePtr() { return singletonRef_s; }
-            static LevelManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } // tolua_export
+            static LevelManager* getInstancePtr() { return singletonPtr_s; }
+            static LevelManager& getInstance()    { return Singleton<LevelManager>::getInstance(); } // tolua_export
 
         private:
@@ -73,5 +76,5 @@
             std::string defaultLevelName_;
 
-            static LevelManager* singletonRef_s;
+            static LevelManager* singletonPtr_s;
     }; // tolua_export
 } // tolua_export
Index: code/branches/resource/src/orxonox/PawnManager.cc
===================================================================
--- code/branches/resource/src/orxonox/PawnManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/PawnManager.cc	(revision 3366)
@@ -34,23 +34,18 @@
 namespace orxonox
 {
-    PawnManager* PawnManager::singletonRef_s = 0;
+    PawnManager* PawnManager::singletonPtr_s = 0;
 
     PawnManager::PawnManager()
     {
         RegisterRootObject(PawnManager);
-
-        assert(PawnManager::singletonRef_s == 0);
-        PawnManager::singletonRef_s = this;
     }
 
     PawnManager::~PawnManager()
     {
-        assert(PawnManager::singletonRef_s != 0);
-        PawnManager::singletonRef_s = 0;
     }
 
     void PawnManager::touch()
     {
-        if (!PawnManager::singletonRef_s)
+        if (!PawnManager::singletonPtr_s)
             new PawnManager();
     }
Index: code/branches/resource/src/orxonox/PawnManager.h
===================================================================
--- code/branches/resource/src/orxonox/PawnManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/PawnManager.h	(revision 3366)
@@ -31,10 +31,13 @@
 
 #include "OrxonoxPrereqs.h"
+
+#include "util/Singleton.h"
 #include "interfaces/Tickable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport PawnManager : public Tickable
+    class _OrxonoxExport PawnManager : protected Singleton<PawnManager>, public Tickable
     {
+            friend class Singleton<PawnManager>;
         public:
             static void touch();
@@ -46,5 +49,5 @@
             virtual ~PawnManager();
 
-            static PawnManager* singletonRef_s;
+            static PawnManager* singletonPtr_s;
     };
 }
Index: code/branches/resource/src/orxonox/PlayerManager.cc
===================================================================
--- code/branches/resource/src/orxonox/PlayerManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/PlayerManager.cc	(revision 3366)
@@ -37,12 +37,9 @@
 namespace orxonox
 {
-    PlayerManager* PlayerManager::singletonRef_s = 0;
+    PlayerManager* PlayerManager::singletonPtr_s = 0;
 
     PlayerManager::PlayerManager()
     {
         RegisterRootObject(PlayerManager);
-
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
 
         this->getConnectedClients();
@@ -51,6 +48,4 @@
     PlayerManager::~PlayerManager()
     {
-        assert(singletonRef_s);
-        singletonRef_s = 0;
     }
 
Index: code/branches/resource/src/orxonox/PlayerManager.h
===================================================================
--- code/branches/resource/src/orxonox/PlayerManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/PlayerManager.h	(revision 3366)
@@ -34,16 +34,15 @@
 #include <cassert>
 #include <map>
+#include "util/Singleton.h"
 #include "network/ClientConnectionListener.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport PlayerManager : public ClientConnectionListener
+    class _OrxonoxExport PlayerManager : public Singleton<PlayerManager>, public ClientConnectionListener
     {
+            friend class Singleton<PlayerManager>;
         public:
             PlayerManager();
             virtual ~PlayerManager();
-
-            inline static PlayerManager& getInstance()
-                { assert(singletonRef_s); return *singletonRef_s; }
 
             PlayerInfo* getClient(unsigned int clientID) const;
@@ -57,5 +56,5 @@
             std::map<unsigned int, PlayerInfo*> clients_;
 
-            static PlayerManager* singletonRef_s;
+            static PlayerManager* singletonPtr_s;
     };
 }
Index: code/branches/resource/src/orxonox/objects/pickup/BaseItem.h
===================================================================
--- code/branches/resource/src/orxonox/objects/pickup/BaseItem.h	(revision 3358)
+++ code/branches/resource/src/orxonox/objects/pickup/BaseItem.h	(revision 3366)
@@ -51,8 +51,5 @@
             Daniel 'Huty' Haggenmueller
     */
-    class _OrxonoxExport BaseItem
-// tolua_end
-        : public BaseObject
-// tolua_begin
+    class _OrxonoxExport BaseItem : public BaseObject
     {
 // tolua_end
Index: code/branches/resource/src/orxonox/objects/pickup/PickupInventory.h
===================================================================
--- code/branches/resource/src/orxonox/objects/pickup/PickupInventory.h	(revision 3358)
+++ code/branches/resource/src/orxonox/objects/pickup/PickupInventory.h	(revision 3366)
@@ -43,10 +43,8 @@
 namespace orxonox
 {
-// tolua_end
     /**
         @brief Static class for the inventory GUI window.
         @author Daniel 'Huty' Haggenmueller
     */
-// tolua_begin
     class _OrxonoxExport PickupInventory
     {
Index: code/branches/resource/src/orxonox/objects/quest/QuestDescription.h
===================================================================
--- code/branches/resource/src/orxonox/objects/quest/QuestDescription.h	(revision 3358)
+++ code/branches/resource/src/orxonox/objects/quest/QuestDescription.h	(revision 3366)
@@ -54,8 +54,7 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestDescription
+    class _OrxonoxExport QuestDescription : public BaseObject
+    {
 // tolua_end
-        : public BaseObject
-    { // tolua_export
         public:
             QuestDescription(BaseObject* creator);
Index: code/branches/resource/src/orxonox/objects/quest/QuestManager.cc
===================================================================
--- code/branches/resource/src/orxonox/objects/quest/QuestManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/objects/quest/QuestManager.cc	(revision 3366)
@@ -47,5 +47,5 @@
 {
     //! Pointer to the current (and single) instance of this class.
-    /*static*/ QuestManager* QuestManager::singletonRef_s = NULL;
+    /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL;
 
     /**
@@ -58,7 +58,4 @@
     {
         RegisterRootObject(QuestManager);
-
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
     }
 
@@ -70,16 +67,4 @@
     {
 
-    }
-
-    /**
-    @brief
-        Returns a reference to the current (and single) instance of the QuestManager, and creates one if there isn't one to begin with.
-    @return
-        Returns a reference to the single instance of the Quest Manager.
-    */
-    /*static*/ QuestManager & QuestManager::getInstance()
-    {
-        assert(singletonRef_s);
-        return *singletonRef_s;
     }
 
Index: code/branches/resource/src/orxonox/objects/quest/QuestManager.h
===================================================================
--- code/branches/resource/src/orxonox/objects/quest/QuestManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/objects/quest/QuestManager.h	(revision 3366)
@@ -40,4 +40,6 @@
 #include <map>
 #include <string>
+
+#include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 
@@ -71,15 +73,14 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestManager
-// tolua_end
-        : public OrxonoxClass
-// tolua_begin
+    class _OrxonoxExport QuestManager : public Singleton<QuestManager>, public orxonox::OrxonoxClass
     {
 // tolua_end
+            friend class Singleton<QuestManager>;
         public:
             QuestManager();
             virtual ~QuestManager();
 
-            static QuestManager& getInstance(); // tolua_export //!< Returns a reference to the single instance of the Quest Manager.
+            //! Returns a reference to the single instance of the Quest Manager.
+            static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
 
             bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
@@ -92,5 +93,5 @@
 
         private:
-            static QuestManager* singletonRef_s;
+            static QuestManager* singletonPtr_s;
 
             std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's.
Index: code/branches/resource/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- code/branches/resource/src/orxonox/overlays/console/InGameConsole.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/overlays/console/InGameConsole.cc	(revision 3366)
@@ -60,5 +60,5 @@
     SetConsoleCommand(InGameConsole, closeConsole, true);
 
-    InGameConsole* InGameConsole::singletonRef_s = 0;
+    InGameConsole* InGameConsole::singletonPtr_s = 0;
 
     /**
@@ -76,7 +76,4 @@
         RegisterObject(InGameConsole);
 
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
-
         this->bActive_ = false;
         this->cursor_ = 0.0f;
@@ -131,6 +128,4 @@
         if (this->consoleOverlay_)
             Ogre::OverlayManager::getSingleton().destroy(consoleOverlay_);
-
-        singletonRef_s = 0;
     }
 
Index: code/branches/resource/src/orxonox/overlays/console/InGameConsole.h
===================================================================
--- code/branches/resource/src/orxonox/overlays/console/InGameConsole.h	(revision 3358)
+++ code/branches/resource/src/orxonox/overlays/console/InGameConsole.h	(revision 3366)
@@ -34,5 +34,7 @@
 
 #include <string>
+
 #include "util/OgreForwardRefs.h"
+#include "util/Singleton.h"
 #include "core/Shell.h"
 #include "core/WindowEventListener.h"
@@ -40,6 +42,7 @@
 namespace orxonox
 {
-    class _OrxonoxExport InGameConsole : public ShellListener, public WindowEventListener
+    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
     {
+        friend class Singleton<InGameConsole>;
     public: // functions
         InGameConsole();
@@ -51,7 +54,4 @@
 
         void update(const Clock& time);
-
-        static InGameConsole& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
-        static InGameConsole* getInstancePtr() { return singletonRef_s; }
 
         static void openConsole();
@@ -112,5 +112,5 @@
         bool bHidesAllInput_;
 
-        static InGameConsole* singletonRef_s;
+        static InGameConsole* singletonPtr_s;
     };
 }
Index: code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.cc
===================================================================
--- code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.cc	(revision 3366)
@@ -46,5 +46,5 @@
     const std::string NotificationManager::NONE = "none";
 
-    NotificationManager* NotificationManager::singletonRef_s = NULL;
+    NotificationManager* NotificationManager::singletonPtr_s = NULL;
 
     /**
@@ -55,7 +55,4 @@
     {
         RegisterRootObject(NotificationManager);
-
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
 
         this->highestIndex_ = 0;
@@ -70,16 +67,4 @@
     }
 
-    /**
-    @brief
-        Returns the current (and single) instance of the NotificationManager. Creates one, if there isn't one to begin with.
-    @return
-        Returns a reference to the single instance of the NotificationManager.
-    */
-    /*static*/ NotificationManager & NotificationManager::getInstance()
-    {
-        assert(singletonRef_s);
-        return *singletonRef_s;
-    }
-    
     /**
     @brief
Index: code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.h
===================================================================
--- code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.h	(revision 3366)
@@ -40,4 +40,6 @@
 #include <map>
 #include <string>
+
+#include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 
@@ -52,6 +54,7 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport NotificationManager : public OrxonoxClass
+    class _OrxonoxExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass
     {
+            friend class Singleton<NotificationManager>;
         public:
             NotificationManager();
@@ -60,6 +63,4 @@
             static const std::string ALL;
             static const std::string NONE;
-
-            static NotificationManager & getInstance(); //! Returns a reference to the single instance of the NotificationManager.
 
             bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.
@@ -88,5 +89,5 @@
 
         private:
-            static NotificationManager* singletonRef_s;
+            static NotificationManager* singletonPtr_s;
 
             int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that  no key appears twice.
Index: code/branches/resource/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/resource/src/orxonox/sound/SoundManager.cc	(revision 3358)
+++ code/branches/resource/src/orxonox/sound/SoundManager.cc	(revision 3366)
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    SoundManager* SoundManager::singletonRef_s = NULL;
+    SoundManager* SoundManager::singletonPtr_s = NULL;
 
     /**
@@ -45,7 +45,4 @@
     SoundManager::SoundManager()
     {
-        assert(singletonRef_s == NULL);
-        singletonRef_s = this;
-
         this->device_ = NULL;
         this->soundavailable_ = true;
@@ -93,7 +90,4 @@
     SoundManager::~SoundManager()
     {
-        assert(singletonRef_s != NULL);
-        singletonRef_s = NULL;
-
         alcDestroyContext(this->context_);
         alcCloseDevice(this->device_);
Index: code/branches/resource/src/orxonox/sound/SoundManager.h
===================================================================
--- code/branches/resource/src/orxonox/sound/SoundManager.h	(revision 3358)
+++ code/branches/resource/src/orxonox/sound/SoundManager.h	(revision 3366)
@@ -32,4 +32,5 @@
 #include <cassert>
 #include <list>
+#include "util/Singleton.h"
 #include "interfaces/Tickable.h"
 
@@ -42,6 +43,7 @@
      *
      */
-    class _OrxonoxExport SoundManager : public Tickable 
+    class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public Tickable
     {
+        friend class Singleton<SoundManager>;
     public:
         SoundManager();
@@ -52,6 +54,4 @@
         bool isSoundAvailable();
 
-        static SoundManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
-
     private:
         ALCdevice* device_;
@@ -60,5 +60,5 @@
         bool soundavailable_;
 
-        static SoundManager* singletonRef_s;
+        static SoundManager* singletonPtr_s;
     }; // class SoundManager
 } // namespace orxonox
