Index: /code/branches/gui/src/core/CorePrereqs.h
===================================================================
--- /code/branches/gui/src/core/CorePrereqs.h	(revision 1688)
+++ /code/branches/gui/src/core/CorePrereqs.h	(revision 1689)
@@ -162,7 +162,7 @@
 
   // game states
+  class GameStateBase;
+  template <class ParentType>
   class GameState;
-  template <class ParentType>
-  class GameStateTyped;
   class RootGameState;
 
Index: /code/branches/gui/src/core/GameState.cc
===================================================================
--- /code/branches/gui/src/core/GameState.cc	(revision 1688)
+++ /code/branches/gui/src/core/GameState.cc	(revision 1689)
@@ -30,5 +30,5 @@
 @file
 @brief
-    Implementation of GameState class.
+    Implementation of GameStateBase class.
 */
 
@@ -43,5 +43,5 @@
         Constructor only initialises variables and sets the name permanently.
     */
-    GameState::GameState(const std::string& name)
+    GameStateBase::GameStateBase(const std::string& name)
         : name_(name)
         //, parent_(0)
@@ -57,5 +57,5 @@
         Destructor only checks that we don't delete an active state.
     */
-    GameState::~GameState()
+    GameStateBase::~GameStateBase()
     {
         OrxAssert(!isInSubtree(getCurrentState()), "Deleting an active GameState is a very bad idea..");
@@ -69,10 +69,10 @@
         The state to be added.
     */
-    void GameState::addChild(GameState* state)
+    void GameStateBase::addChild(GameStateBase* 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, GameState*>::const_iterator it = state->allChildren_.begin();
+        for (std::map<std::string, GameStateBase*>::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, GameState*>::const_iterator it = state->allChildren_.begin();
+        for (std::map<std::string, GameStateBase*>::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 GameState::removeChild(GameState* state)
-    {
-        std::map<GameState*, GameState*>::iterator it = this->grandchildrenToChildren_.find(state);
+    void GameStateBase::removeChild(GameStateBase* state)
+    {
+        std::map<GameStateBase*, GameStateBase*>::iterator it = this->grandchildrenToChildren_.find(state);
         if (it != this->grandchildrenToChildren_.end())
         {
@@ -127,5 +127,5 @@
             else
             {
-                for (std::map<GameState*, GameState*>::const_iterator it = state->grandchildrenToChildren_.begin();
+                for (std::map<GameStateBase*, GameStateBase*>::const_iterator it = state->grandchildrenToChildren_.begin();
                     it != state->grandchildrenToChildren_.end(); ++it)
                     this->grandchildRemoved(it->first);
@@ -150,7 +150,7 @@
     */
 
-    void GameState::removeChild(const std::string& name)
-    {
-        GameState* state = getState(name);
+    void GameStateBase::removeChild(const std::string& name)
+    {
+        GameStateBase* state = getState(name);
         if (state)
         {
@@ -173,5 +173,5 @@
         The child that has been added.
     */
-    inline void GameState::grandchildAdded(GameState* child, GameState* grandchild)
+    inline void GameStateBase::grandchildAdded(GameStateBase* child, GameStateBase* grandchild)
     {
         // fill the two maps correctly.
@@ -191,5 +191,5 @@
         The child that has been removed.
     */
-    inline void GameState::grandchildRemoved(GameState* grandchild)
+    inline void GameStateBase::grandchildRemoved(GameStateBase* grandchild)
     {
         // adjust the two maps correctly.
@@ -206,5 +206,5 @@
         Remember that the every node has a map with all its child nodes.
     */
-    GameState* GameState::getState(const std::string& name)
+    GameStateBase* GameStateBase::getState(const std::string& name)
     {
         if (this->getParent())
@@ -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, GameState*>::const_iterator it = this->allChildren_.find(name);
+            std::map<std::string, GameStateBase*>::const_iterator it = this->allChildren_.find(name);
             return (it!= this->allChildren_.end() ? it->second : 0);
         }
@@ -225,5 +225,5 @@
         Returns the root node of the tree.
     */
-    GameState* GameState::getRoot()
+    GameStateBase* GameStateBase::getRoot()
     {
         if (this->getParent())
@@ -240,5 +240,5 @@
         have active children itself. Many states can be active at once.
     */
-    GameState* GameState::getCurrentState()
+    GameStateBase* GameStateBase::getCurrentState()
     {
         if (this->operation_.active)
@@ -262,5 +262,5 @@
         Determines whether 'state' is in this subtree, including this node.
     */
-    bool GameState::isInSubtree(GameState* state) const
+    bool GameStateBase::isInSubtree(GameStateBase* state) const
     {
         return (grandchildrenToChildren_.find(state) != grandchildrenToChildren_.end()
@@ -275,5 +275,5 @@
         The state to be entered, has to exist in the tree.
     */
-    void GameState::requestState(const std::string& name)
+    void GameStateBase::requestState(const std::string& name)
     {
         assert(getRoot());
@@ -286,5 +286,5 @@
         the method can assume certain things to be granted (like 'this' is always active).
     */
-    void GameState::makeTransition(GameState* source, GameState* destination)
+    void GameStateBase::makeTransition(GameStateBase* source, GameStateBase* destination)
     {
         if (source == this->getParent())
@@ -308,5 +308,5 @@
 
         // Check for 'destination' in the children map first
-        std::map<GameState*, GameState*>::const_iterator it
+        std::map<GameStateBase*, GameStateBase*>::const_iterator it
             = this->grandchildrenToChildren_.find(destination);
         if (it != this->grandchildrenToChildren_.end())
@@ -330,5 +330,5 @@
         Activates the state. Only sets bActive_ to true and notifies the parent.
     */
-    void GameState::activate()
+    void GameStateBase::activate()
     {
         this->operation_.active = true;
@@ -341,5 +341,5 @@
         Activates the state. Only sets bActive_ to false and notifies the parent.
     */
-    void GameState::deactivate()
+    void GameStateBase::deactivate()
     {
         this->operation_.leaving = true;
@@ -358,5 +358,5 @@
         This method is not virtual! You cannot override it therefore.
     */
-    void GameState::tick(const Clock& time)
+    void GameStateBase::tick(const Clock& time)
     {
         this->operation_.running = true;
Index: /code/branches/gui/src/core/GameState.h
===================================================================
--- /code/branches/gui/src/core/GameState.h	(revision 1688)
+++ /code/branches/gui/src/core/GameState.h	(revision 1689)
@@ -61,9 +61,9 @@
         Then Bar stores Foo in map by its name. The other one then maps Foo to Foofoo.
     */
-    class _CoreExport GameState
+    class _CoreExport GameStateBase
     {
         friend class RootGameState;
         template <class ParentType>
-        friend class GameStateTyped;
+        friend class GameState;
 
     public:
@@ -82,19 +82,19 @@
 
     public:
-        virtual ~GameState();
+        virtual ~GameStateBase();
 
         const std::string& getName() const { return name_; }
         const Operations getOperation() const { return this->operation_; }
-        bool isInSubtree(GameState* state) const;
+        bool isInSubtree(GameStateBase* state) const;
 
-        GameState* getState(const std::string& name);
-        GameState* getRoot();
+        GameStateBase* getState(const std::string& name);
+        GameStateBase* getRoot();
         //! Returns the currently active game state
-        virtual GameState* getCurrentState();
+        virtual GameStateBase* getCurrentState();
 
         virtual void requestState(const std::string& name);
 
-        void addChild(GameState* state);
-        void removeChild(GameState* state);
+        void addChild(GameStateBase* state);
+        void removeChild(GameStateBase* state);
         void removeChild(const std::string& name);
 
@@ -104,21 +104,21 @@
         virtual void ticked(const Clock& time) = 0;
 
-        GameState* getActiveChild() { return this->activeChild_; }
+        GameStateBase* getActiveChild() { return this->activeChild_; }
 
         void tickChild(const Clock& time) { if (this->getActiveChild()) this->getActiveChild()->tick(time); }
 
-        virtual GameState* getParent() const = 0;
-        virtual void setParent(GameState* state) = 0;
+        virtual GameStateBase* getParent() const = 0;
+        virtual void setParent(GameStateBase* state) = 0;
 
     private:
         // Making the constructor private ensures that game states
-        // are always derivates of GameStateTyped<T>. Note the friend declaration above.
-        GameState(const std::string& name);
+        // 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);
+        virtual void makeTransition(GameStateBase* source, GameStateBase* destination);
 
-        void grandchildAdded(GameState* child, GameState* grandchild);
-        void grandchildRemoved(GameState* grandchild);
+        void grandchildAdded(GameStateBase* child, GameStateBase* grandchild);
+        void grandchildRemoved(GameStateBase* grandchild);
 
         void tick(const Clock& time);
@@ -126,18 +126,19 @@
         void deactivate();
 
-        const std::string                   name_;
-        Operations                          operation_;
-        GameState*                          activeChild_;
-        //bool                                bPauseParent_;
-        std::map<std::string, GameState*>   allChildren_;
-        std::map<GameState*, GameState*>    grandchildrenToChildren_;
+        const std::string                        name_;
+        Operations                               operation_;
+        GameStateBase*                           activeChild_;
+        //bool                                     bPauseParent_;
+        std::map<std::string, GameStateBase*>    allChildren_;
+        std::map<GameStateBase*, GameStateBase*> grandchildrenToChildren_;
     };
 
+
     template <class ParentType>
-    class GameStateTyped : public GameState
+    class GameState : public GameStateBase
     {
     public:
-        GameStateTyped(const std::string& name) : GameState(name) { }
-        virtual ~GameStateTyped() { }
+        GameState(const std::string& name) : GameStateBase(name) { }
+        virtual ~GameState() { }
 
         ParentType* getParent() const
@@ -145,5 +146,5 @@
 
     protected:
-        void setParent(GameState* state)
+        void setParent(GameStateBase* state)
         {
             assert(dynamic_cast<ParentType*>(state) != 0);
Index: /code/branches/gui/src/core/RootGameState.cc
===================================================================
--- /code/branches/gui/src/core/RootGameState.cc	(revision 1688)
+++ /code/branches/gui/src/core/RootGameState.cc	(revision 1689)
@@ -39,5 +39,5 @@
 
     RootGameState::RootGameState(const std::string& name)
-        : GameStateTyped<GameState>(name)
+        : GameState<GameStateBase>(name)
         , stateRequest_("")
     {
@@ -53,5 +53,5 @@
         the method can assume certain things to be granted (like 'this' is always active).
     */
-    void RootGameState::makeTransition(GameState* source, GameState* destination)
+    void RootGameState::makeTransition(GameStateBase* source, GameStateBase* destination)
     {
         if (source != 0)
@@ -68,11 +68,11 @@
 
         // Check for 'destination' in the children map first
-        std::map<GameState*, GameState*>::const_iterator it
+        std::map<GameStateBase*, GameStateBase*>::const_iterator it
             = this->grandchildrenToChildren_.find(destination);
         if (it != this->grandchildrenToChildren_.end())
         {
-            OrxAssert(dynamic_cast<GameState*>(it->second) != 0,
+            OrxAssert(dynamic_cast<GameStateBase*>(it->second) != 0,
                 "There was a mix with RootGameState and GameState, could not cast.");
-            GameState* child = static_cast<GameState*>(it->second);
+            GameStateBase* child = static_cast<GameStateBase*>(it->second);
             // child state. Don't use 'state', might be a grandchild!
             this->activeChild_ = child;
@@ -88,8 +88,8 @@
     void RootGameState::gotoState(const std::string& name)
     {
-        GameState* request = getState(name);
+        GameStateBase* request = getState(name);
         if (request)
         {
-            GameState* current = getCurrentState();
+            GameStateBase* current = getCurrentState();
             if (current)
             {
@@ -127,6 +127,8 @@
         State to start with (usually main menu or specified by command line)
     */
-    void RootGameState::start()
+    void RootGameState::start(int argc, char** argv)
     {
+        parseCommandLine(argc, argv);
+
         this->activate();
 
@@ -149,3 +151,20 @@
         this->deactivate();
     }
+
+    void RootGameState::parseCommandLine(int argc, char** argv)
+    {
+        std::vector<std::string> args;
+        for (int i = 1; i < argc; ++i)
+            args.push_back(argv[i]);
+
+        try
+        {
+            orxonox::CommandLine::parse(args);
+        }
+        catch (orxonox::ArgumentException& ex)
+        {
+            COUT(1) << ex.what() << std::endl;
+            COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
+        }
+    }
 }
Index: /code/branches/gui/src/core/RootGameState.h
===================================================================
--- /code/branches/gui/src/core/RootGameState.h	(revision 1688)
+++ /code/branches/gui/src/core/RootGameState.h	(revision 1689)
@@ -35,5 +35,5 @@
 namespace orxonox
 {
-    class _CoreExport RootGameState : public GameStateTyped<GameState>
+    class _CoreExport RootGameState : public GameState<GameStateBase>
     {
     public:
@@ -42,9 +42,11 @@
 
         void requestState(const std::string& name);
-        void start();
+        void start(int argc, char** argv);
 
     private:
-        void makeTransition(GameState* source, GameState* destination);
+        void makeTransition(GameStateBase* source, GameStateBase* destination);
         void gotoState(const std::string& name);
+
+        void parseCommandLine(int argc, char** argv);
 
         std::string           stateRequest_;
Index: /code/branches/gui/src/orxonox/Main.cc
===================================================================
--- /code/branches/gui/src/orxonox/Main.cc	(revision 1688)
+++ /code/branches/gui/src/orxonox/Main.cc	(revision 1689)
@@ -48,5 +48,4 @@
 #include "gamestates/GSClient.h"
 #include "gamestates/GSGUI.h"
-#include "gamestates/GSIO.h"
 #include "gamestates/GSIOConsole.h"
 
@@ -90,38 +89,4 @@
     SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
 
-
-    /*GameState* state1 = new GameState("state1");
-    GameState* state2 = new GameState("state2");
-    GameState* state3 = new GameState("state3");
-    GameState* state4 = new GameState("state4");
-    GameState* state5 = new GameState("state5");
-    GameState* state6 = new GameState("state6");
-
-    state1->addChild(state4);
-    state1->addChild(state6);
-    state2->addChild(state3);
-    state2->addChild(state5);
-    state6->addChild(state2);
-
-    state6->removeChild("state2");
-
-    state5->requestState("state3");
-    COUT(2) << std::endl;
-    state2->requestState("state2");
-    COUT(2) << std::endl;
-    state2->requestState("state1");
-    COUT(2) << std::endl;
-    state4->requestState("state3");
-    COUT(2) << std::endl;
-    state1->requestState("state4");
-    COUT(2) << std::endl;
-    state1->requestState("state2");
-    COUT(2) << std::endl;
-    state1->requestState("stat");
-    COUT(2) << std::endl;
-    state1->requestState("state5");
-    COUT(2) << std::endl;*/
-
-
     GSRoot root;
     GSGraphics graphics;
@@ -140,6 +105,5 @@
     root.addChild(&ioConsole);
 
-    root.feedCommandLine(argc, argv);
-    root.start();
+    root.start(argc, argv);
 
     return 0;
Index: /code/branches/gui/src/orxonox/gamestates/GSGUI.cc
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSGUI.cc	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSGUI.cc	(revision 1689)
@@ -39,5 +39,5 @@
 {
     GSGUI::GSGUI()
-        : GameStateTyped<GSGraphics>("gui")
+        : GameState<GSGraphics>("gui")
     {
     }
Index: /code/branches/gui/src/orxonox/gamestates/GSGUI.h
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSGUI.h	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSGUI.h	(revision 1689)
@@ -36,5 +36,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSGUI : public GameStateTyped<GSGraphics>
+    class _OrxonoxExport GSGUI : public GameState<GSGraphics>
     {
     public:
Index: /code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSGraphics.cc	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSGraphics.cc	(revision 1689)
@@ -57,5 +57,5 @@
 {
     GSGraphics::GSGraphics()
-        : GameStateTyped<GSRoot>("graphics")
+        : GameState<GSRoot>("graphics")
         , ogreRoot_(0)
         , inputManager_(0)
Index: /code/branches/gui/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSGraphics.h	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSGraphics.h	(revision 1689)
@@ -39,5 +39,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSGraphics : public GameStateTyped<GSRoot>, public OrxonoxClass, public Ogre::WindowEventListener
+    class _OrxonoxExport GSGraphics : public GameState<GSRoot>, public OrxonoxClass, public Ogre::WindowEventListener
     {
         friend class ClassIdentifier<GSGraphics>;
Index: /code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc	(revision 1689)
@@ -42,5 +42,5 @@
 {
     GSIOConsole::GSIOConsole()
-        : GameStateTyped<GSRoot>("ioConsole")
+        : GameState<GSRoot>("ioConsole")
     {
     }
Index: /code/branches/gui/src/orxonox/gamestates/GSIOConsole.h
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSIOConsole.h	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSIOConsole.h	(revision 1689)
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSIOConsole : public GameStateTyped<GSRoot>
+    class _OrxonoxExport GSIOConsole : public GameState<GSRoot>
     {
     public:
Index: /code/branches/gui/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSLevel.cc	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSLevel.cc	(revision 1689)
@@ -45,5 +45,5 @@
 {
     GSLevel::GSLevel(const std::string& name)
-        : GameStateTyped<GSGraphics>(name)
+        : GameState<GSGraphics>(name)
         , timeFactor_(1.0f)
         , sceneManager_(0)
Index: /code/branches/gui/src/orxonox/gamestates/GSLevel.h
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSLevel.h	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSLevel.h	(revision 1689)
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSLevel : public GameStateTyped<GSGraphics>
+    class _OrxonoxExport GSLevel : public GameState<GSGraphics>
     {
     public:
Index: /code/branches/gui/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSRoot.cc	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSRoot.cc	(revision 1689)
@@ -91,31 +91,4 @@
     }
 
-    //SetCommandLineArgument(asdf1, "haha").setShortcut("a").setUsageInformation("1|2|3");
-    //SetCommandLineArgument(asdf2, 3).setShortcut("b");
-    //SetCommandLineArgument(asdf3, Vector2()).setShortcut("c");
-    //SetCommandLineArgument(adsf4, 1.4f).setShortcut("d");
-    //SetCommandLineSwitch(showGraphics).setShortcut("g");
-
-    void GSRoot::feedCommandLine(int argc, char** argv)
-    {
-        std::vector<std::string> args;
-        for (int i = 1; i < argc; ++i)
-            args.push_back(argv[i]);
-
-        //std::string line = "-a --asdf3 (3,3) -d -5 -b - 5.4";
-        //SubString tokens(line, " ", " ", false, 92, false, 34, true, 40, 41, false, 0);
-
-        try
-        {
-            orxonox::CommandLine::parse(args);
-            //CommandLine::parse(tokens.getAllStrings());
-        }
-        catch (orxonox::ArgumentException& ex)
-        {
-            COUT(1) << ex.what() << std::endl;
-            COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
-        }
-    }
-
     void GSRoot::enter()
     {
@@ -165,5 +138,5 @@
 
         // add console commands
-        FunctorMember01<GameState, const std::string&>* functor2 = createFunctor(&GameState::requestState);
+        FunctorMember01<GameStateBase, const std::string&>* functor2 = createFunctor(&GameStateBase::requestState);
         functor2->setObject(this);
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor2, "selectGameState"));
Index: /code/branches/gui/src/orxonox/gamestates/GSRoot.h
===================================================================
--- /code/branches/gui/src/orxonox/gamestates/GSRoot.h	(revision 1688)
+++ /code/branches/gui/src/orxonox/gamestates/GSRoot.h	(revision 1689)
@@ -44,6 +44,4 @@
         ~GSRoot();
 
-        void feedCommandLine(int argc, char** argv);
-
         void exitGame()
         { requestState("root"); }
