Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 24, 2008, 12:43:13 AM (16 years ago)
Author:
rgrieder
Message:

Simplified CommandLineArgument by using the new MultiType.
That also enables to get a cmd argument even if you don't know the exact type. It simply gets converted.

Location:
code/branches/objecthierarchy/src/orxonox/gamestates
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSClient.cc

    r1949 r2003  
    3737namespace orxonox
    3838{
    39     SetCommandLineArgument(ip, "127.0.0.1").setInformation("#.#.#.#");
     39    SetCommandLineArgument(ip, "127.0.0.1").information("#.#.#.#");
    4040
    4141    GSClient::GSClient()
     
    5555        GSLevel::enter();
    5656
    57         int serverPort = CommandLine::getArgument<int>("port")->getValue();
    58         std::string serverIP = CommandLine::getArgument<std::string>("ip")->getValue();
    59         this->client_ = new network::Client(serverIP, serverPort);
     57        this->client_ = new network::Client((std::string)CommandLine::getValue("ip"), CommandLine::getValue("port"));
    6058
    6159        if(!client_->establishConnection())
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc

    r1949 r2003  
    7070        timeFactor_ = 1.0f;
    7171
    72         int serverPort = CommandLine::getArgument<int>("port")->getValue();
    73         this->server_ = new network::Server(serverPort);
     72        this->server_ = new network::Server(CommandLine::getValue("port"));
    7473
    7574        // call the loader
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSRoot.cc

    r1891 r2003  
    6161namespace orxonox
    6262{
    63     SetCommandLineArgument(dataPath, "").setInformation("PATH");
    64     SetCommandLineArgument(limitToCPU, 1).setInformation("0: off | #cpu");
     63    SetCommandLineArgument(dataPath, "").information("PATH");
     64    SetCommandLineArgument(limitToCPU, 1).information("0: off | #cpu");
    6565
    6666    GSRoot::GSRoot()
     
    9191        this->settings_ = new Settings();
    9292
    93         std::string dataPath;
    94         CommandLine::getValue("dataPath", &dataPath);
     93        std::string dataPath = CommandLine::getValue("dataPath");
    9594        if (dataPath != "")
    9695        {
     
    111110        // do this after ogre has initialised. Somehow Ogre changes the settings again (not through
    112111        // the timer though).
    113         int limitToCPU;
    114         CommandLine::getValue("limitToCPU", &limitToCPU);
     112        int limitToCPU = CommandLine::getValue("limitToCPU");
    115113        if (limitToCPU > 0)
    116114            setThreadAffinity((unsigned int)(limitToCPU - 1));
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSServer.cc

    r1949 r2003  
    3838namespace orxonox
    3939{
    40     SetCommandLineArgument(port, 55556).setShortcut("p").setInformation("0-65535");
     40    SetCommandLineArgument(port, 55556).shortcut("p").information("0-65535");
    4141
    4242    GSServer::GSServer()
     
    5656        GSLevel::enter();
    5757
    58         int serverPort = CommandLine::getArgument<int>("port")->getValue();
    59         this->server_ = new network::Server(serverPort);
     58        this->server_ = new network::Server(CommandLine::getValue("port"));
    6059        COUT(0) << "Loading scene in server mode" << std::endl;
    6160
Note: See TracChangeset for help on using the changeset viewer.