| 34 | } |
| 35 | |
| 36 | bool ConsoleInterface::addCommand(String_t name, String_t description, |
| 37 | CommandClientFunction_t commandClient, |
| 38 | CommandServerFunction_t commandServer, |
| 39 | std::initializer_list<ModeType> allowedModes, |
| 40 | std::initializer_list<String_t> aliases) |
| 41 | { |
| 42 | CommandPtr_t commandPtr = std::make_shared<Command>(commandClient, commandServer, description, allowedModes); |
| 43 | mCommandMap.emplace(name, commandPtr); |
| 44 | for(auto& alias : aliases) |
| 45 | { |
| 46 | mCommandMap.emplace(alias, commandPtr); |
| 47 | } |
| 48 | return true; |
| 49 | } |
| 50 | |
| 51 | Command::Result ConsoleInterface::tryExecuteClientCommand(String_t commandString, |
| 52 | ModeType modeType, |
no outgoing calls