Index: code/branches/gui/src/core/CorePrereqs.h
===================================================================
--- code/branches/gui/src/core/CorePrereqs.h	(revision 2816)
+++ code/branches/gui/src/core/CorePrereqs.h	(revision 2817)
@@ -166,6 +166,4 @@
 
   // game states
-  class GameStateBase;
-  template <class ParentType>
   class GameState;
   class RootGameState;
Index: code/branches/gui/src/core/GameState.cc
===================================================================
--- code/branches/gui/src/core/GameState.cc	(revision 2816)
+++ code/branches/gui/src/core/GameState.cc	(revision 2817)
@@ -30,5 +30,5 @@
 @file
 @brief
-    Implementation of GameStateBase class.
+    Implementation of GameState class.
 */
 
@@ -43,7 +43,7 @@
         Constructor only initialises variables and sets the name permanently.
     */
-    GameStateBase::GameStateBase(const std::string& name)
+    GameState::GameState(const std::string& name)
         : name_(name)
-        //, parent_(0)
+        , parent_(0)
         , activeChild_(0)
         //, bPausegetParent()(false)
@@ -57,5 +57,5 @@
         Destructor only checks that we don't delete an active state.
     */
-    GameStateBase::~GameStateBase()
+    GameState::~GameState()
     {
         OrxAssert(this->operation_.active == false, "Deleting an active GameState is a very bad idea..");
@@ -69,10 +69,10 @@
         The state to be added.
     */
-    void GameStateBase::addChild(GameStateBase* state)
+    void GameState::addChild(GameState* state)
     {
         if (!state)
             return;
         // check if the state/tree to be added has states in it that already exist in this tree.
-        for (std::map<std::string, GameStateBase*>::const_iterator it = state->allChildren_.begin();
+        for (std::map<std::string, GameState*>::const_iterator it = state->allChildren_.begin();
             it != state->allChildren_.end(); ++it)
         {
@@ -96,5 +96,5 @@
 
         // merge the child's children into this tree
-        for (std::map<std::string, GameStateBase*>::const_iterator it = state->allChildren_.begin();
+        for (std::map<std::string, GameState*>::const_iterator it = state->allChildren_.begin();
             it != state->allChildren_.end(); ++it)
             this->grandchildAdded(state, it->second);
@@ -113,7 +113,7 @@
         GameState by instance pointer
     */
-    void GameStateBase::removeChild(GameStateBase* state)
-    {
-        std::map<GameStateBase*, GameStateBase*>::iterator it = this->grandchildrenToChildren_.find(state);
+    void GameState::removeChild(GameState* state)
+    {
+        std::map<GameState*, GameState*>::iterator it = this->grandchildrenToChildren_.find(state);
         if (it != this->grandchildrenToChildren_.end())
         {
@@ -127,5 +127,5 @@
             else
             {
-                for (std::map<GameStateBase*, GameStateBase*>::const_iterator it = state->grandchildrenToChildren_.begin();
+                for (std::map<GameState*, GameState*>::const_iterator it = state->grandchildrenToChildren_.begin();
                     it != state->grandchildrenToChildren_.end(); ++it)
                     this->grandchildRemoved(it->first);
@@ -150,7 +150,7 @@
     */
 
-    void GameStateBase::removeChild(const std::string& name)
-    {
-        GameStateBase* state = getState(name);
+    void GameState::removeChild(const std::string& name)
+    {
+        GameState* state = getState(name);
         if (state)
         {
@@ -173,11 +173,11 @@
         The child that has been added.
     */
-    inline void GameStateBase::grandchildAdded(GameStateBase* child, GameStateBase* grandchild)
+    inline void GameState::grandchildAdded(GameState* child, GameState* grandchild)
     {
         // fill the two maps correctly.
         this->allChildren_[grandchild->getName()] = grandchild;
         this->grandchildrenToChildren_[grandchild] = child;
-        if (this->getParentAsBase())
-            this->getParentAsBase()->grandchildAdded(this, grandchild);
+        if (this->getParent())
+            this->getParent()->grandchildAdded(this, grandchild);
     }
 
@@ -191,11 +191,11 @@
         The child that has been removed.
     */
-    inline void GameStateBase::grandchildRemoved(GameStateBase* grandchild)
+    inline void GameState::grandchildRemoved(GameState* grandchild)
     {
         // adjust the two maps correctly.
         this->allChildren_.erase(grandchild->getName());
         this->grandchildrenToChildren_.erase(grandchild);
-        if (this->getParentAsBase())
-            this->getParentAsBase()->grandchildRemoved(grandchild);
+        if (this->getParent())
+            this->getParent()->grandchildRemoved(grandchild);
     }
 
@@ -206,8 +206,8 @@
         Remember that the every node has a map with all its child nodes.
     */
-    GameStateBase* GameStateBase::getState(const std::string& name)
-    {
-        if (this->getParentAsBase())
-            return this->getParentAsBase()->getState(name);
+    GameState* GameState::getState(const std::string& name)
+    {
+        if (this->getParent())
+            return this->getParent()->getState(name);
         else
         {
@@ -216,5 +216,5 @@
                 return this;
             // Search in the map. If there is no entry, we can be sure the state doesn't exist.
-            std::map<std::string, GameStateBase*>::const_iterator it = this->allChildren_.find(name);
+            std::map<std::string, GameState*>::const_iterator it = this->allChildren_.find(name);
             return (it!= this->allChildren_.end() ? it->second : 0);
         }
@@ -225,8 +225,8 @@
         Returns the root node of the tree.
     */
-    GameStateBase* GameStateBase::getRoot()
-    {
-        if (this->getParentAsBase())
-            return this->getParentAsBase()->getRoot();
+    GameState* GameState::getRoot()
+    {
+        if (this->getParent())
+            return this->getParent()->getRoot();
         else
             return this;
@@ -240,5 +240,5 @@
         have active children itself. Many states can be active at once.
     */
-    GameStateBase* GameStateBase::getCurrentState()
+    GameState* GameState::getCurrentState()
     {
         if (this->operation_.active)
@@ -251,6 +251,6 @@
         else
         {
-            if (this->getParentAsBase())
-                return this->getParentAsBase()->getCurrentState();
+            if (this->getParent())
+                return this->getParent()->getCurrentState();
             else
                 return 0;
@@ -262,5 +262,5 @@
         Determines whether 'state' is in this subtree, including this node.
     */
-    bool GameStateBase::isInSubtree(GameStateBase* state) const
+    bool GameState::isInSubtree(GameState* state) const
     {
         return (grandchildrenToChildren_.find(state) != grandchildrenToChildren_.end()
@@ -275,5 +275,5 @@
         The state to be entered, has to exist in the tree.
     */
-    void GameStateBase::requestState(const std::string& name)
+    void GameState::requestState(const std::string& name)
     {
         assert(getRoot());
@@ -286,7 +286,7 @@
         the method can assume certain things to be granted (like 'this' is always active).
     */
-    void GameStateBase::makeTransition(GameStateBase* source, GameStateBase* destination)
-    {
-        if (source == this->getParentAsBase())
+    void GameState::makeTransition(GameState* source, GameState* destination)
+    {
+        if (source == this->getParent())
         {
             // call is from the parent
@@ -308,5 +308,5 @@
 
         // Check for 'destination' in the children map first
-        std::map<GameStateBase*, GameStateBase*>::const_iterator it
+        std::map<GameState*, GameState*>::const_iterator it
             = this->grandchildrenToChildren_.find(destination);
         if (it != this->grandchildrenToChildren_.end())
@@ -319,8 +319,8 @@
         {
             // parent. We can be sure of this.
-            assert(this->getParentAsBase() != 0);
+            assert(this->getParent() != 0);
 
             this->deactivate();
-            this->getParentAsBase()->makeTransition(this, destination);
+            this->getParent()->makeTransition(this, destination);
         }
     }
@@ -330,5 +330,5 @@
         Activates the state. Only sets bActive_ to true and notifies the parent.
     */
-    void GameStateBase::activate()
+    void GameState::activate()
     {
         this->operation_.active = true;
@@ -341,5 +341,5 @@
         Activates the state. Only sets bActive_ to false and notifies the parent.
     */
-    void GameStateBase::deactivate()
+    void GameState::deactivate()
     {
         this->operation_.leaving = true;
@@ -358,5 +358,5 @@
         This method is not virtual! You cannot override it therefore.
     */
-    void GameStateBase::tick(const Clock& time)
+    void GameState::tick(const Clock& time)
     {
         this->operation_.running = true;
Index: code/branches/gui/src/core/GameState.h
===================================================================
--- code/branches/gui/src/core/GameState.h	(revision 2816)
+++ code/branches/gui/src/core/GameState.h	(revision 2817)
@@ -60,9 +60,7 @@
         Then Bar stores Foo in map by its name. The other one then maps Foo to Foofoo.
     */
-    class _CoreExport GameStateBase
+    class _CoreExport GameState
     {
         friend class RootGameState;
-        template <class ParentType>
-        friend class GameState;
         // Hack
         friend class Game;
@@ -83,19 +81,20 @@
 
     public:
-        virtual ~GameStateBase();
+        GameState(const std::string& name);
+        virtual ~GameState();
 
         const std::string& getName() const { return name_; }
         const Operations getOperation() const { return this->operation_; }
-        bool isInSubtree(GameStateBase* state) const;
+        bool isInSubtree(GameState* state) const;
 
-        GameStateBase* getState(const std::string& name);
-        GameStateBase* getRoot();
+        GameState* getState(const std::string& name);
+        GameState* getRoot();
         //! Returns the currently active game state
-        virtual GameStateBase* getCurrentState();
+        virtual GameState* getCurrentState();
 
         virtual void requestState(const std::string& name);
 
-        void addChild(GameStateBase* state);
-        void removeChild(GameStateBase* state);
+        void addChild(GameState* state);
+        void removeChild(GameState* state);
         void removeChild(const std::string& name);
 
@@ -105,21 +104,17 @@
         virtual void ticked(const Clock& time) = 0;
 
-        GameStateBase* getActiveChild() { return this->activeChild_; }
+        GameState* getActiveChild() { return this->activeChild_; }
 
         void tickChild(const Clock& time) { if (this->getActiveChild()) this->getActiveChild()->tick(time); }
 
-        virtual GameStateBase* getParentAsBase() const = 0;
-        virtual void setParent(GameStateBase* state) = 0;
+        GameState* getParent() const     { return this->parent_; }
+        void setParent(GameState* state) { this->parent_ = state; }
 
     private:
-        // Making the constructor private ensures that game states
-        // are always derivates of GameState<T>. Note the friend declaration above.
-        GameStateBase(const std::string& name);
+        //! Performs a transition to 'destination'
+        virtual void makeTransition(GameState* source, GameState* destination);
 
-        //! Performs a transition to 'destination'
-        virtual void makeTransition(GameStateBase* source, GameStateBase* destination);
-
-        void grandchildAdded(GameStateBase* child, GameStateBase* grandchild);
-        void grandchildRemoved(GameStateBase* grandchild);
+        void grandchildAdded(GameState* child, GameState* grandchild);
+        void grandchildRemoved(GameState* grandchild);
 
         void tick(const Clock& time);
@@ -129,36 +124,9 @@
         const std::string                        name_;
         Operations                               operation_;
-        GameStateBase*                           activeChild_;
+        GameState*                               parent_;
+        GameState*                               activeChild_;
         //bool                                     bPauseParent_;
-        std::map<std::string, GameStateBase*>    allChildren_;
-        std::map<GameStateBase*, GameStateBase*> grandchildrenToChildren_;
-    };
-
-
-    template <class ParentType>
-    class GameState : public GameStateBase
-    {
-    public:
-        GameState(const std::string& name)
-            : GameStateBase(name)
-            , parent_(0)
-        { }
-        virtual ~GameState() { }
-
-        GameStateBase* getParentAsBase() const
-            { return parent_; }
-
-        ParentType* getParent() const
-            { return parent_; }
-
-    protected:
-        void setParent(GameStateBase* state)
-        {
-            assert(dynamic_cast<ParentType*>(state) != 0);
-            this->parent_ = dynamic_cast<ParentType*>(state);
-        }
-
-    private:
-        ParentType* parent_;
+        std::map<std::string, GameState*>        allChildren_;
+        std::map<GameState*, GameState*>         grandchildrenToChildren_;
     };
 }
Index: code/branches/gui/src/core/RootGameState.cc
===================================================================
--- code/branches/gui/src/core/RootGameState.cc	(revision 2816)
+++ code/branches/gui/src/core/RootGameState.cc	(revision 2817)
@@ -36,5 +36,5 @@
 {
     RootGameState::RootGameState(const std::string& name)
-        : GameState<GameStateBase>(name)
+        : GameState(name)
         , stateRequest_("")
     {
@@ -50,5 +50,5 @@
         the method can assume certain things to be granted (like 'this' is always active).
     */
-    void RootGameState::makeTransition(GameStateBase* source, GameStateBase* destination)
+    void RootGameState::makeTransition(GameState* source, GameState* destination)
     {
         if (source != 0)
@@ -65,11 +65,11 @@
 
         // Check for 'destination' in the children map first
-        std::map<GameStateBase*, GameStateBase*>::const_iterator it
+        std::map<GameState*, GameState*>::const_iterator it
             = this->grandchildrenToChildren_.find(destination);
         if (it != this->grandchildrenToChildren_.end())
         {
-            OrxAssert(static_cast<GameStateBase*>(it->second) != 0,
+            OrxAssert(static_cast<GameState*>(it->second) != 0,
                 "There was a mix with RootGameState and GameState, could not cast.");
-            GameStateBase* child = static_cast<GameStateBase*>(it->second);
+            GameState* child = static_cast<GameState*>(it->second);
             // child state. Don't use 'state', might be a grandchild!
             this->activeChild_ = child;
@@ -85,8 +85,8 @@
     void RootGameState::gotoState(const std::string& name)
     {
-        GameStateBase* request = getState(name);
+        GameState* request = getState(name);
         if (request)
         {
-            GameStateBase* current = getCurrentState();
+            GameState* current = getCurrentState();
             if (current)
             {
Index: code/branches/gui/src/core/RootGameState.h
===================================================================
--- code/branches/gui/src/core/RootGameState.h	(revision 2816)
+++ code/branches/gui/src/core/RootGameState.h	(revision 2817)
@@ -35,5 +35,5 @@
 namespace orxonox
 {
-    class _CoreExport RootGameState : public GameState<GameStateBase>
+    class _CoreExport RootGameState : public GameState
     {
         // Hack!
@@ -47,5 +47,5 @@
 
     private:
-        void makeTransition(GameStateBase* source, GameStateBase* destination);
+        void makeTransition(GameState* source, GameState* destination);
         void gotoState(const std::string& name);
 
