Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2015, 10:56:26 PM (9 years ago)
Author:
landauf
Message:

made ConsoleCommandManager a singleton.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/command/CommandEvaluation.cc

    r10347 r10484  
    306306                // the user typed 1-2 arguments, check what he tried to type and print a suitable error
    307307                std::string groupLC = getLowercase(this->getToken(0));
    308                 for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getCommandsLC().begin(); it_group != ConsoleCommandManager::getCommandsLC().end(); ++it_group)
     308                for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getInstance().getCommandsLC().begin(); it_group != ConsoleCommandManager::getInstance().getCommandsLC().end(); ++it_group)
    309309                    if (it_group->first == groupLC)
    310310                        return std::string("Error: There is no command in group \"") + this->getToken(0) + "\" starting with \"" + this->getToken(1) + "\".";
     
    328328
    329329        // iterate through all groups and their commands and calculate the distance to the current command. keep the best.
    330         for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getCommandsLC().begin(); it_group != ConsoleCommandManager::getCommandsLC().end(); ++it_group)
     330        for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getInstance().getCommandsLC().begin(); it_group != ConsoleCommandManager::getInstance().getCommandsLC().end(); ++it_group)
    331331        {
    332332            if (it_group->first != "")
     
    346346
    347347        // now also iterate through all shortcuts and keep the best if it's better than the one found above.
    348         std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getCommandsLC().find("");
    349         if (it_group !=  ConsoleCommandManager::getCommandsLC().end())
     348        std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getInstance().getCommandsLC().find("");
     349        if (it_group !=  ConsoleCommandManager::getInstance().getCommandsLC().end())
    350350        {
    351351            for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = it_group->second.begin(); it_name != it_group->second.end(); ++it_name)
Note: See TracChangeset for help on using the changeset viewer.