MCPcopy Create free account
hub / github.com/axmolengine/axmol / ConsoleCustomCommand

Method ConsoleCustomCommand

tests/cpp-tests/Source/ConsoleTest/ConsoleTest.cpp:69–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67//------------------------------------------------------------------
68
69ConsoleCustomCommand::ConsoleCustomCommand()
70{
71 _console = Director::getInstance()->getConsole();
72 static Console::Command commands[] = {
73 {"hello", "This is just a user generated command",
74 [](int fd, std::string_view args) {
75 const char msg[] = "how are you?\nArguments passed: ";
76 send(fd, msg, sizeof(msg), 0);
77 send(fd, args.data(), args.length(), 0);
78 send(fd, "\n", 1, 0);
79 }},
80 };
81 _console->addCommand(commands[0]);
82}
83
84ConsoleCustomCommand::~ConsoleCustomCommand() {}
85

Callers

nothing calls this directly

Calls 4

getInstanceFunction · 0.85
dataMethod · 0.45
lengthMethod · 0.45
addCommandMethod · 0.45

Tested by

no test coverage detected