Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2008, 3:54:20 PM (17 years ago)
Author:
rgrieder
Message:
  • @everyone: Do not create a branch until I've added the svn:eol-style property correctly. Otherwise this would cost me another 4 hours or so when we want to merge back.
  • merged network branch back to trunk
  • I had to omit the changes from last evening concerning the line endings
  • might not work yet because of the line endings
  • @beni: script branch is the only branch still open. you probably will have to apply a patch because of inconsistent new lines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/Identifier.cc

    r1062 r1502  
    3737
    3838#include "Factory.h"
    39 #include "Executor.h"
     39#include "ConsoleCommand.h"
    4040#include "CommandExecutor.h"
    4141
     
    231231    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
    232232    {
     233        std::map<std::string, ConfigValueContainer*>::const_iterator it = this->configValues_.find(varname);
     234        if (it != this->configValues_.end())
     235        {
     236            COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << "." << std::endl;
     237        }
     238
    233239        this->bHasConfigValues_ = true;
    234240        this->configValues_[varname] = container;
     
    270276        @return The executor of the command
    271277    */
    272     ExecutorStatic& Identifier::addConsoleCommand(ExecutorStatic* executor, bool bCreateShortcut)
    273     {
     278    ConsoleCommand& Identifier::addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut)
     279    {
     280        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(command->getName());
     281        if (it != this->consoleCommands_.end())
     282        {
     283            COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << "." << std::endl;
     284        }
     285
    274286        this->bHasConsoleCommands_ = true;
    275         this->consoleCommands_[executor->getName()] = executor;
    276         this->consoleCommands_LC_[getLowercase(executor->getName())] = executor;
     287        this->consoleCommands_[command->getName()] = command;
     288        this->consoleCommands_LC_[getLowercase(command->getName())] = command;
    277289
    278290        if (bCreateShortcut)
    279             CommandExecutor::addConsoleCommandShortcut(executor);
    280 
    281         return (*executor);
     291            CommandExecutor::addConsoleCommandShortcut(command);
     292
     293        return (*command);
    282294    }
    283295
     
    287299        @return The executor of the requested console command
    288300    */
    289     ExecutorStatic* Identifier::getConsoleCommand(const std::string& name) const
    290     {
    291         std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_.find(name);
     301    ConsoleCommand* Identifier::getConsoleCommand(const std::string& name) const
     302    {
     303        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(name);
    292304        if (it != this->consoleCommands_.end())
    293305            return (*it).second;
     
    301313        @return The executor of the requested console command
    302314    */
    303     ExecutorStatic* Identifier::getLowercaseConsoleCommand(const std::string& name) const
    304     {
    305         std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_LC_.find(name);
     315    ConsoleCommand* Identifier::getLowercaseConsoleCommand(const std::string& name) const
     316    {
     317        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_LC_.find(name);
    306318        if (it != this->consoleCommands_LC_.end())
    307319            return (*it).second;
Note: See TracChangeset for help on using the changeset viewer.