Class endstone::CommandMap¶
ClassList > endstone > CommandMap
Represents a command map that manages all commands of the Server .
#include <endstone/command/command_map.h>
Public Functions¶
Type | Name |
---|---|
CommandMap () = default |
|
CommandMap (const CommandMap &) = delete |
|
CommandMap (CommandMap &&) = default |
|
virtual void | clearCommands () = 0 |
virtual bool | dispatch (CommandSender & sender, std::string command_line) const = 0 Looks for the requested command and executes it if found. |
virtual Command * | getCommand (std::string name) const = 0 |
CommandMap & | operator= (const CommandMap &) = delete |
CommandMap & | operator= (CommandMap &&) = default |
virtual bool | registerCommand (std::shared_ptr< Command > command) = 0 |
virtual | ~CommandMap () = default |
Public Functions Documentation¶
function CommandMap [⅓]¶
function CommandMap [⅔]¶
function CommandMap [3/3]¶
function clearCommands¶
Clears all registered commands.
function dispatch¶
Looks for the requested command and executes it if found.
virtual bool endstone::CommandMap::dispatch (
CommandSender & sender,
std::string command_line
) const = 0
Parameters:
sender
The command's sendercommand_line
command + arguments. Example: "/test abc 123"
Returns:
true if execution is successful, false otherwise
function getCommand¶
Gets the command registered to the specified name
Parameters:
name
Name of the command to retrieve
Returns:
Command with the specified name or nullptr if a command with that label doesn't exist
function operator=¶
function operator=¶
function registerCommand¶
Registers a command.
Parameters:
command
the command to register
Returns:
true on success, false if a command with the same name is already registered
function ~CommandMap¶
The documentation for this class was generated from the following file include/endstone/command/command_map.h