Skip to content

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 [⅓]

endstone::CommandMap::CommandMap () = default

function CommandMap [⅔]

endstone::CommandMap::CommandMap (
    const CommandMap &
) = delete

function CommandMap [3/3]

endstone::CommandMap::CommandMap (
    CommandMap &&
) = default

function clearCommands

virtual void endstone::CommandMap::clearCommands () = 0

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 sender
  • command_line command + arguments. Example: "/test abc 123"

Returns:

true if execution is successful, false otherwise


function getCommand

virtual Command * endstone::CommandMap::getCommand (
    std::string name
) const = 0

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=

CommandMap & endstone::CommandMap::operator= (
    const CommandMap &
) = delete

function operator=

CommandMap & endstone::CommandMap::operator= (
    CommandMap &&
) = default

function registerCommand

virtual bool endstone::CommandMap::registerCommand (
    std::shared_ptr< Command > command
) = 0

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

virtual endstone::CommandMap::~CommandMap () = default


The documentation for this class was generated from the following file include/endstone/command/command_map.h