Index: code/branches/objecthierarchy/src/core/CommandLine.cc
===================================================================
--- code/branches/objecthierarchy/src/core/CommandLine.cc	(revision 2002)
+++ code/branches/objecthierarchy/src/core/CommandLine.cc	(revision 2003)
@@ -35,9 +35,50 @@
     /**
     @brief
+        Parses a value string for a command line argument.
+        It simply uses convertValue(Output, Input) to do that.
+        Bools are treated specially. That is necessary
+        so that you can have simple command line switches.
+    */
+    void CommandLineArgument::parse(const std::string& value)
+    {
+        if (value_.getType() == MT_bool)
+        {
+            // simulate command line switch
+            bool temp;
+            if (convertValue(&temp, value))
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = temp;
+            }
+            else if (value == "")
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = true;
+            }
+            else
+            {
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+            }
+        }
+        else
+        {
+            if (!value_.setValue(value))
+            {
+                value_.setValue(defaultValue_);
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+            }
+            else
+                this->bHasDefaultValue_ = false;
+        }
+    }
+
+
+    /**
+    @brief
         Destructor destroys all CommandLineArguments with it.
     */
     CommandLine::~CommandLine()
     {
-        for (std::map<std::string, BaseCommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
             it != cmdLineArgs_.end(); ++it)
         {
@@ -73,5 +114,5 @@
         {
             // first shove all the shortcuts in a map
-            for (std::map<std::string, BaseCommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
+            for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
                 it != cmdLineArgs_.end(); ++it)
             {
@@ -178,5 +219,5 @@
     void CommandLine::checkFullArgument(const std::string& name, const std::string& value)
     {
-        std::map<std::string, BaseCommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
         if (it == cmdLineArgs_.end())
             ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
@@ -195,5 +236,5 @@
     void CommandLine::checkShortcut(const std::string& shortcut, const std::string& value)
     {
-        std::map<std::string, BaseCommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
         if (it == cmdLineArgsShortcut_.end())
             ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
@@ -206,5 +247,5 @@
         CommandLine* inst = &_getInstance();
         std::string infoStr;
-        for (std::map<std::string, BaseCommandLineArgument*>::const_iterator it = inst->cmdLineArgs_.begin();
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst->cmdLineArgs_.begin();
             it != inst->cmdLineArgs_.end(); ++it)
         {
@@ -214,3 +255,22 @@
     }
 
+    /**
+    @brief
+        Retrieves a CommandLineArgument.
+        The method throws an exception if 'name' was not found or the value could not be converted.
+    @note
+        You shold of course not call this method before the command line has been parsed.
+    */
+    const CommandLineArgument* CommandLine::getArgument(const std::string& name)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+        if (it == _getInstance().cmdLineArgs_.end())
+        {
+            ThrowException(Argument, "Could find command line argument '" + name + "'.");
+        }
+        else
+        {
+            return it->second;
+        }
+    }
 }
Index: code/branches/objecthierarchy/src/core/CommandLine.h
===================================================================
--- code/branches/objecthierarchy/src/core/CommandLine.h	(revision 2002)
+++ code/branches/objecthierarchy/src/core/CommandLine.h	(revision 2003)
@@ -35,10 +35,11 @@
 #include "util/Debug.h"
 #include "util/Exception.h"
+#include "util/MultiType.h"
 
 #define SetCommandLineArgument(name, defaultValue) \
-    BaseCommandLineArgument& CmdArgumentDummyBoolVar##name \
+    CommandLineArgument& CmdArgumentDummyBoolVar##name \
     = orxonox::CommandLine::addArgument(#name, defaultValue)
 #define SetCommandLineSwitch(name) \
-    BaseCommandLineArgument& CmdArgumentDummyBoolVar##name \
+    CommandLineArgument& CmdArgumentDummyBoolVar##name \
     = orxonox::CommandLine::addArgument(#name, false)
 
@@ -62,55 +63,5 @@
     /**
     @brief
-        Base class for CommandLineArguments.
-    */
-    class _CoreExport BaseCommandLineArgument
-    {
-        friend class CommandLine;
-
-    public:
-        //! Tells whether the value has been changed by the command line.
-        bool hasDefaultValue() const { return bHasDefaultValue_; }
-        //! Returns the name of the argument.
-        const std::string& getName() const { return name_; }
-
-        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
-        //! Evaluates to "" if none there is none.
-        const std::string& getShortcut() const { return shortcut_; }
-        //! Sets the shortcut for the argument
-        BaseCommandLineArgument& setShortcut(const std::string& shortcut)
-        { this->shortcut_ = shortcut; return *this; }
-
-        //! Returns the usage information
-        const std::string& getInformation() const { return this->usageInformation_; }
-        //! Sets the option information when displaying orxonox usage.
-        BaseCommandLineArgument& setInformation(const std::string& usage)
-        { this->usageInformation_ = usage; return *this; }
-
-    protected:
-        BaseCommandLineArgument(const std::string& name)
-            : bHasDefaultValue_(true)
-            , name_(name)
-        { }
-
-        //! Undefined copy constructor
-        BaseCommandLineArgument(const BaseCommandLineArgument& instance);
-        virtual ~BaseCommandLineArgument() { }
-
-        //! Parses the value string of a command line argument.
-        virtual void parse(const std::string& value) = 0;
-
-        //! Tells whether the value has been changed by the command line.
-        bool bHasDefaultValue_;
-
-    private:
-        std::string name_;             //!< Name of the argument
-        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
-        std::string usageInformation_; //!< Tells about the usage of this parameter
-    };
-
-
-    /**
-    @brief
-        Container class for a command line argument of type T.
+        Container class for a command line argument of any type supported by MultiType.
         
         Whenever you want to have an option specified by a command line switch,
@@ -127,72 +78,59 @@
         CommandLine class. It is a Singleton, but the public interface is static.
     */
-    template <class T>
-    class CommandLineArgument : public BaseCommandLineArgument
-    {
-        // Only let CommandLine change the value.
+    class _CoreExport CommandLineArgument
+    {
         friend class CommandLine;
 
     public:
+        //! Tells whether the value has been changed by the command line.
+        bool hasDefaultValue() const { return bHasDefaultValue_; }
+        //! Returns the name of the argument.
+        const std::string& getName() const { return name_; }
+
+        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
+        //! Evaluates to "" if none there is none.
+        const std::string& getShortcut() const { return shortcut_; }
+        //! Sets the shortcut for the argument
+        CommandLineArgument& shortcut(const std::string& shortcut)
+        { this->shortcut_ = shortcut; return *this; }
+
+        //! Returns the usage information
+        const std::string& getInformation() const { return this->usageInformation_; }
+        //! Sets the option information when displaying orxonox usage.
+        CommandLineArgument& information(const std::string& usage)
+        { this->usageInformation_ = usage; return *this; }
+
         //! Returns the actual value of the argument. Can be equal to default value.
-        T getValue() const { return value_; }
+        MultiType getValue() const { return value_; }
         //! Returns the given default value as type T.
-        T getDefaultValue() const { return defaultValue_; }
+        MultiType getDefaultValue() const { return defaultValue_; }
 
     private:
         //! Constructor initialises both value_ and defaultValue_ with defaultValue.
-        CommandLineArgument(const std::string& name, const T& defaultValue)
-            : BaseCommandLineArgument(name)
+        CommandLineArgument(const std::string& name, const MultiType& defaultValue)
+            : bHasDefaultValue_(true)
+            , name_(name)
             , value_(defaultValue)
             , defaultValue_(defaultValue)
         { }
 
-        virtual void parse(const std::string& value);
-
-        T value_;            //!< The actual value
-        T defaultValue_;     //!< Default value. Should not be changed.
+        //! Undefined copy constructor
+        CommandLineArgument(const CommandLineArgument& instance);
+        ~CommandLineArgument() { }
+
+        //! Parses the value string of a command line argument.
+        void parse(const std::string& value);
+
+        //! Tells whether the value has been changed by the command line.
+        bool bHasDefaultValue_;
+
+    private:
+        std::string name_;             //!< Name of the argument
+        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
+        std::string usageInformation_; //!< Tells about the usage of this parameter
+
+        MultiType value_;            //!< The actual value
+        MultiType defaultValue_;     //!< Default value. Should not be changed.
     };
-
-    /**
-    @brief
-        Parses a value string for a command line argument.
-        It simply uses convertValue(Output, Input) to do that.
-    */
-    template <class T>
-    void CommandLineArgument<T>::parse(const std::string& value)
-    {
-        if (convertValue(&this->value_, value))
-        {
-            this->bHasDefaultValue_ = false;
-        }
-        else
-        {
-            ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-        }
-    }
-
-    /**
-    @brief
-        Parses a value string for a command line argument.
-        It simply uses convertValue(Output, Input) to do that.
-        This is a template specialisation for bool type. That is necessary
-        so that you can have simple command line switches.
-    */
-    template <>
-    inline void CommandLineArgument<bool>::parse(const std::string& value)
-    {
-        if (convertValue(&this->value_, value))
-        {
-            this->bHasDefaultValue_ = false;
-        }
-        else if (value == "")
-        {
-            this->bHasDefaultValue_ = false;
-            this->value_ = true;
-        }
-        else
-        {
-            ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-        }
-    }
 
 
@@ -215,12 +153,20 @@
         static std::string getUsageInformation();
 
-        template <class T>
-        static const CommandLineArgument<T>* getArgument(const std::string& name);
+        static const CommandLineArgument* getArgument(const std::string& name);
         //! Writes the argument value in the given parameter.
         template <class T>
         static void getValue(const std::string& name, T* value)
-        { *value = getArgument<T>(name)->getValue(); }
+        { *value = (T)(getArgument(name)->getValue()); }
+        static MultiType getValue(const std::string& name)
+        { return getArgument(name)->getValue(); }
         template <class T>
-        static BaseCommandLineArgument& addArgument(const std::string& name, T defaultValue);
+        static CommandLineArgument& addArgument(const std::string& name, T defaultValue);
+
+        static bool existsArgument(const std::string& name)
+        {
+            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+            return !(it == _getInstance().cmdLineArgs_.end());
+        }
+
 
     private:
@@ -237,11 +183,6 @@
         void checkShortcut(const std::string& shortcut, const std::string& value);
 
-        template <class T>
-        BaseCommandLineArgument* createArg(const std::string& name, T defaultValue, Int2Type<0> isString);
-        template <class T>
-        BaseCommandLineArgument* createArg(const std::string& name, T defaultValue, Int2Type<1> isString);
-
         /**
-            Tells whether we parse the first expression. The CommmandLineArguments are added before main().
+            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
             So when we call parse() the first time, we need to create a map with all shortcuts since these
             get added after addCommandLineArgument().
@@ -250,39 +191,9 @@
 
         //! Holds all pointers to the arguments and serves as a search map by name.
-        std::map<std::string, BaseCommandLineArgument*> cmdLineArgs_;
+        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
         //! Search map by chortcut for the arguments.
-        std::map<std::string, BaseCommandLineArgument*> cmdLineArgsShortcut_;
+        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
     };
 
-
-    /**
-    @brief
-        Retrieves a CommandLineArgument.
-        The method throws an exception if 'name' was not found or the value could not be converted.
-    @note
-        You shold of course not call this method before the command line has been parsed.
-    */
-    template <class T>
-    const CommandLineArgument<T>* CommandLine::getArgument(const std::string& name)
-    {
-        std::map<std::string, BaseCommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-        if (it == _getInstance().cmdLineArgs_.end())
-        {
-            ThrowException(Argument, "Could find command line argument '" + name + "'.");
-        }
-        else
-        {
-            CommandLineArgument<T>* arg = dynamic_cast<CommandLineArgument<T>* >(it->second);
-            if (arg == 0)
-            {
-                ThrowException(Argument, "Could not convert command line argument value to requested type. " \
-                    "You should use exactly the same type as predefined.");
-            }
-            else
-            {
-                return arg;
-            }
-        }
-    }
 
     /**
@@ -294,38 +205,13 @@
     @param defaultValue
         Default value that is used when argument was not given.
-    @note
-        In order to store char* strings as std::string too, there's
-        little bit of template programming involved:
-        StaticConversions::exists determines whether T converts to std::string.
-        Int2Type<int> is then used to call the right function. One returns
-        a CommandLineArgument<T> and the other CommandLineArgument<std::string>.
     */
     template <class T>
-    BaseCommandLineArgument& CommandLine::addArgument(const std::string& name, T defaultValue)
-    {
-        std::map<std::string, BaseCommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+    CommandLineArgument& CommandLine::addArgument(const std::string& name, T defaultValue)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
         OrxAssert(it == _getInstance().cmdLineArgs_.end(),
             "Cannot add a command line argument with name '" + name + "' twice.");
 
-        return *(_getInstance().cmdLineArgs_[name] = 
-            _getInstance().createArg(name, defaultValue, Int2Type<StaticConversion<T, std::string>::exists>()));
-    }
-
-    /**
-        Returns a new CommandLineArgument<T>.
-    */
-    template <class T>
-    BaseCommandLineArgument* CommandLine::createArg(const std::string& name, T defaultValue, Int2Type<0> isPrime)
-    {
-        return new CommandLineArgument<T>(name, defaultValue);
-    }
-
-    /**
-        Returns a new CommandLineArgument<std::string>.
-    */
-    template <class T>
-    BaseCommandLineArgument* CommandLine::createArg(const std::string& name, T defaultValue, Int2Type<1> isPrime)
-    {
-        return new CommandLineArgument<std::string>(name, defaultValue);
+        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
     }
 }
Index: code/branches/objecthierarchy/src/core/CorePrereqs.h
===================================================================
--- code/branches/objecthierarchy/src/core/CorePrereqs.h	(revision 2002)
+++ code/branches/objecthierarchy/src/core/CorePrereqs.h	(revision 2003)
@@ -103,6 +103,4 @@
   class CommandExecutor;
   class CommandLine;
-  class BaseCommandLineArgument;
-  template <class T>
   class CommandLineArgument;
   class ConfigFile;
Index: code/branches/objecthierarchy/src/core/RootGameState.cc
===================================================================
--- code/branches/objecthierarchy/src/core/RootGameState.cc	(revision 2002)
+++ code/branches/objecthierarchy/src/core/RootGameState.cc	(revision 2003)
@@ -39,5 +39,5 @@
 namespace orxonox
 {
-    SetCommandLineArgument(state, "gui").setShortcut("s");
+    SetCommandLineArgument(state, "gui").shortcut("s");
 
     RootGameState::RootGameState(const std::string& name)
@@ -147,7 +147,5 @@
 
             // get initial state from command line
-            std::string initialState;
-            CommandLine::getValue<std::string>("state", &initialState);
-            gotoState(initialState);
+            gotoState(CommandLine::getValue("state"));
 
             while (this->activeChild_)
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSClient.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSClient.cc	(revision 2002)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSClient.cc	(revision 2003)
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    SetCommandLineArgument(ip, "127.0.0.1").setInformation("#.#.#.#");
+    SetCommandLineArgument(ip, "127.0.0.1").information("#.#.#.#");
 
     GSClient::GSClient()
@@ -55,7 +55,5 @@
         GSLevel::enter();
 
-        int serverPort = CommandLine::getArgument<int>("port")->getValue();
-        std::string serverIP = CommandLine::getArgument<std::string>("ip")->getValue();
-        this->client_ = new network::Client(serverIP, serverPort);
+        this->client_ = new network::Client((std::string)CommandLine::getValue("ip"), CommandLine::getValue("port"));
 
         if(!client_->establishConnection())
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc	(revision 2002)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc	(revision 2003)
@@ -70,6 +70,5 @@
         timeFactor_ = 1.0f;
 
-        int serverPort = CommandLine::getArgument<int>("port")->getValue();
-        this->server_ = new network::Server(serverPort);
+        this->server_ = new network::Server(CommandLine::getValue("port"));
 
         // call the loader
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSRoot.cc	(revision 2002)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSRoot.cc	(revision 2003)
@@ -61,6 +61,6 @@
 namespace orxonox
 {
-    SetCommandLineArgument(dataPath, "").setInformation("PATH");
-    SetCommandLineArgument(limitToCPU, 1).setInformation("0: off | #cpu");
+    SetCommandLineArgument(dataPath, "").information("PATH");
+    SetCommandLineArgument(limitToCPU, 1).information("0: off | #cpu");
 
     GSRoot::GSRoot()
@@ -91,6 +91,5 @@
         this->settings_ = new Settings();
 
-        std::string dataPath;
-        CommandLine::getValue("dataPath", &dataPath);
+        std::string dataPath = CommandLine::getValue("dataPath");
         if (dataPath != "")
         {
@@ -111,6 +110,5 @@
         // do this after ogre has initialised. Somehow Ogre changes the settings again (not through
         // the timer though).
-        int limitToCPU;
-        CommandLine::getValue("limitToCPU", &limitToCPU);
+        int limitToCPU = CommandLine::getValue("limitToCPU");
         if (limitToCPU > 0)
             setThreadAffinity((unsigned int)(limitToCPU - 1));
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSServer.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSServer.cc	(revision 2002)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSServer.cc	(revision 2003)
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    SetCommandLineArgument(port, 55556).setShortcut("p").setInformation("0-65535");
+    SetCommandLineArgument(port, 55556).shortcut("p").information("0-65535");
 
     GSServer::GSServer()
@@ -56,6 +56,5 @@
         GSLevel::enter();
 
-        int serverPort = CommandLine::getArgument<int>("port")->getValue();
-        this->server_ = new network::Server(serverPort);
+        this->server_ = new network::Server(CommandLine::getValue("port"));
         COUT(0) << "Loading scene in server mode" << std::endl;
 
