Manages the chat commands. More...
#include <CommandManager.h>
Public Member Functions | |
CommandManager () | |
Initializes the command-maps. | |
int | RegisterCommands (std::map< std::string, std::function< void(Player, std::vector< std::string >)>> methods) |
Registers the chat commands (from the plugins). More... | |
int | RegisterAdminCommands (std::map< std::string, std::function< void(Player, std::vector< std::string >)>> methods) |
Registers the admin chat commands (from the plugins). More... | |
void | HandleCommand (Player player, std::string text) |
Handles chat commands (from PlayerChat callback). More... | |
Private Attributes | |
std::map< std::string, std::function< void(Player, std::vector< std::string >)> > | commands |
Map with normal chat commands. | |
std::map< std::string, std::function< void(Player, std::vector< std::string >)> > | adminCommands |
Map with admin chat commands. | |
Manages the chat commands.
void CommandManager::HandleCommand | ( | Player | player, |
std::string | text | ||
) |
Handles chat commands (from PlayerChat callback).
player | Author of the command request. |
text | Chat message. |
int CommandManager::RegisterAdminCommands | ( | std::map< std::string, std::function< void(Player, std::vector< std::string >)>> | methods | ) |
Registers the admin chat commands (from the plugins).
methods | Plugin methods with admin command name. |
int CommandManager::RegisterCommands | ( | std::map< std::string, std::function< void(Player, std::vector< std::string >)>> | methods | ) |
Registers the chat commands (from the plugins).
methods | Plugin methods with command name. |