Changeset 1502 for code/trunk/src/core/Identifier.cc
- Timestamp:
- Jun 1, 2008, 3:54:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/Identifier.cc
r1062 r1502 37 37 38 38 #include "Factory.h" 39 #include " Executor.h"39 #include "ConsoleCommand.h" 40 40 #include "CommandExecutor.h" 41 41 … … 231 231 void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container) 232 232 { 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 233 239 this->bHasConfigValues_ = true; 234 240 this->configValues_[varname] = container; … … 270 276 @return The executor of the command 271 277 */ 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 274 286 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; 277 289 278 290 if (bCreateShortcut) 279 CommandExecutor::addConsoleCommandShortcut( executor);280 281 return (* executor);291 CommandExecutor::addConsoleCommandShortcut(command); 292 293 return (*command); 282 294 } 283 295 … … 287 299 @return The executor of the requested console command 288 300 */ 289 ExecutorStatic* Identifier::getConsoleCommand(const std::string& name) const290 { 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); 292 304 if (it != this->consoleCommands_.end()) 293 305 return (*it).second; … … 301 313 @return The executor of the requested console command 302 314 */ 303 ExecutorStatic* Identifier::getLowercaseConsoleCommand(const std::string& name) const304 { 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); 306 318 if (it != this->consoleCommands_LC_.end()) 307 319 return (*it).second;
Note: See TracChangeset
for help on using the changeset viewer.