![]() |
xyginext
0.2.0
Second generation of xygine game creation framework
|
Interface for registering console commands. To register a command with the console a class needs to inherit this interface, which ensures proper lifetime of console commands which refer to specific instances of an object. More...
#include <ConsoleClient.hpp>
Public Member Functions | |
ConsoleClient (const ConsoleClient &)=default | |
ConsoleClient (ConsoleClient &&)=default | |
ConsoleClient & | operator= (const ConsoleClient &)=default |
ConsoleClient & | operator= (ConsoleClient &&)=default |
void | registerCommand (const std::string &command, const std::function< void(const std::string &)> &func) |
Registers a command with the console. More... | |
Interface for registering console commands. To register a command with the console a class needs to inherit this interface, which ensures proper lifetime of console commands which refer to specific instances of an object.
void xy::ConsoleClient::registerCommand | ( | const std::string & | command, |
const std::function< void(const std::string &)> & | func | ||
) |
Registers a command with the console.
command | A string containing the name of the command. Must NOT contain spaces |
func | A Console::Command containing the function to execute when the command is received |