| 443 | } |
| 444 | |
| 445 | void Console::addCommand(const Command& cmd) |
| 446 | { |
| 447 | Command* newCommand = new Command(cmd); |
| 448 | auto iter = _commands.find(cmd.getName()); |
| 449 | if (iter != _commands.end()) |
| 450 | { |
| 451 | delete iter->second; |
| 452 | _commands.erase(iter); |
| 453 | } |
| 454 | _commands.emplace(cmd.getName(), newCommand); // _commands[cmd.getName()] = newCommand; |
| 455 | } |
| 456 | |
| 457 | void Console::addSubCommand(std::string_view cmdName, const Command& subCmd) |
| 458 | { |