Index: /code/branches/core7/src/libraries/core/singleton/Scope.h
===================================================================
--- /code/branches/core7/src/libraries/core/singleton/Scope.h	(revision 10512)
+++ /code/branches/core7/src/libraries/core/singleton/Scope.h	(revision 10513)
@@ -68,6 +68,5 @@
     class _CoreExport ScopeListener
     {
-        template <ScopeID::Value scope>
-        friend class Scope;
+        friend class ScopeManager;
 
         protected:
@@ -108,9 +107,4 @@
                 Loki::ScopeGuard deactivator = Loki::MakeObjGuard(*this, &Scope::deactivateScope);
                 ScopeManager::getInstance().addScope(scope);
-                for (typename std::set<ScopeListener*>::iterator it = ScopeManager::getInstance().getListeners(scope).begin(); it != ScopeManager::getInstance().getListeners(scope).end(); )
-                {
-                    (*it)->activated();
-                    (*(it++))->bActivated_ = true;
-                }
                 deactivator.Dismiss();
 
@@ -132,17 +126,4 @@
             {
                 ScopeManager::getInstance().removeScope(scope);
-                for (typename std::set<ScopeListener*>::iterator it = ScopeManager::getInstance().getListeners(scope).begin(); it != ScopeManager::getInstance().getListeners(scope).end(); )
-                {
-                    if ((*it)->bActivated_)
-                    {
-                        try
-                            { (*it)->deactivated(); }
-                        catch (...)
-                            { orxout(internal_warning) << "ScopeListener::deactivated() failed! This MUST NOT happen, fix it!" << endl; }
-                        (*(it++))->bActivated_ = false;
-                    }
-                    else
-                        ++it;
-                }
             }
 
Index: /code/branches/core7/src/libraries/core/singleton/ScopeManager.cc
===================================================================
--- /code/branches/core7/src/libraries/core/singleton/ScopeManager.cc	(revision 10512)
+++ /code/branches/core7/src/libraries/core/singleton/ScopeManager.cc	(revision 10513)
@@ -29,5 +29,5 @@
 /**
     @file
-    @brief Static linkage of the two maps in orxonox::ScopeManager.
+    @brief Implementation of orxonox::ScopeManager.
 */
 
@@ -47,4 +47,5 @@
     {
         this->activeScopes_.insert(scope);
+        this->activateListenersForScope(scope);
     }
 
@@ -52,4 +53,5 @@
     {
         this->activeScopes_.erase(scope);
+        this->deactivateListenersForScope(scope);
     }
 
@@ -68,3 +70,31 @@
         this->listeners_[listener->getScope()].erase(listener);
     }
+
+    void ScopeManager::activateListenersForScope(ScopeID::Value scope)
+    {
+        for (typename std::set<ScopeListener*>::iterator it = this->listeners_[scope].begin(); it != this->listeners_[scope].end(); ++it)
+            this->activateListener(*it);
+    }
+
+    void ScopeManager::deactivateListenersForScope(ScopeID::Value scope)
+    {
+        for (typename std::set<ScopeListener*>::iterator it = this->listeners_[scope].begin(); it != this->listeners_[scope].end(); ++it)
+            if ((*it)->bActivated_)
+                this->deactivateListener(*it);
+    }
+
+    void ScopeManager::activateListener(ScopeListener* listener)
+    {
+        listener->activated();
+        listener->bActivated_ = true;
+    }
+
+    void ScopeManager::deactivateListener(ScopeListener* listener)
+    {
+        try
+            { listener->deactivated(); }
+        catch (...)
+            { orxout(internal_warning) << "ScopeListener::deactivated() failed! This MUST NOT happen, fix it!" << endl; }
+        listener->bActivated_ = false;
+    }
 }
Index: /code/branches/core7/src/libraries/core/singleton/ScopeManager.h
===================================================================
--- /code/branches/core7/src/libraries/core/singleton/ScopeManager.h	(revision 10512)
+++ /code/branches/core7/src/libraries/core/singleton/ScopeManager.h	(revision 10513)
@@ -57,15 +57,23 @@
             static ScopeManager& getInstance();
 
+            /** Adds a scope and activates all listeners which are registered for this scope */
             void addScope(ScopeID::Value scope);
+            /** Removes a scope and deactivates all listeners which are registered for this scope */
             void removeScope(ScopeID::Value scope);
+            /** Returns true if this scope is active */
             bool isActive(ScopeID::Value scope);
 
+            /** Registers a listener for the given scope. */
             void addListener(ScopeListener* listener);
+            /** Unregisters a listener for the given scope. */
             void removeListener(ScopeListener* listener);
 
-            inline std::set<ScopeListener*>& getListeners(ScopeID::Value scope)
-                { return this->listeners_[scope]; }
+        private:
+            void activateListenersForScope(ScopeID::Value scope);
+            void deactivateListenersForScope(ScopeID::Value scope);
 
-        private:
+            void activateListener(ScopeListener* listener);
+            void deactivateListener(ScopeListener* listener);
+
             std::set<ScopeID::Value> activeScopes_;
             std::map<ScopeID::Value, std::set<ScopeListener*> > listeners_; //!< Stores all listeners for a scope
