MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / addCommand

Method addCommand

source/modes/ConsoleInterface.cpp:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool 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
51Command::Result ConsoleInterface::tryExecuteClientCommand(String_t commandString,
52 ModeType modeType,

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.80
addConsoleCommandsFunction · 0.80

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64