Mania++
 All Classes Functions Variables Pages
Public Member Functions | Private Attributes | List of all members
CommandManager Class Reference

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.
 

Detailed Description

Manages the chat commands.

Member Function Documentation

void CommandManager::HandleCommand ( Player  player,
std::string  text 
)

Handles chat commands (from PlayerChat callback).

Parameters
playerAuthor of the command request.
textChat 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).

Parameters
methodsPlugin 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).

Parameters
methodsPlugin methods with command name.

The documentation for this class was generated from the following files: