Class endstone::PluginCommand¶
ClassList > endstone > PluginCommand
Represents a Command belonging to aPlugin .
#include <endstone/command/plugin_command.h>
Inherits the following classes: endstone::Command
Public Functions¶
Type | Name |
---|---|
PluginCommand (const Command & command, Plugin & owner) |
|
virtual PluginCommand * | asPluginCommand () override const |
virtual bool | execute (CommandSender & sender, const std::vector< std::string > & args) override const |
virtual CommandExecutor & | getExecutor () const |
Plugin & | getPlugin () const |
virtual void | setExecutor (std::shared_ptr< CommandExecutor > executor) |
Public Functions inherited from endstone::Command¶
Type | Name |
---|---|
Command (std::string name, std::string description="", std::vector< std::string > usages={}, std::vector< std::string > aliases={}, std::vector< std::string > permissions={}) |
|
virtual PluginCommand * | asPluginCommand () const |
virtual bool | execute (CommandSender & sender, const std::vector< std::string > & args) const |
std::vector< std::string > | getAliases () const |
std::string | getDescription () const |
std::string | getName () const |
std::vector< std::string > | getPermissions () const |
std::vector< std::string > | getUsages () const |
bool | isRegistered () const |
bool | registerTo (CommandMap & command_map) |
void | setAliases (Alias... aliases) |
void | setDescription (std::string description) |
void | setName (std::string name) |
void | setPermissions (Permission... permissions) |
void | setUsages (Usage... usages) |
bool | testPermission (const CommandSender & target) const |
bool | testPermissionSilently (const CommandSender & target) const |
bool | unregisterFrom (const CommandMap & command_map) |
virtual | ~Command () = default |
Public Functions Documentation¶
function PluginCommand¶
function asPluginCommand¶
Implements endstone::Command::asPluginCommand
function execute¶
inline virtual bool endstone::PluginCommand::execute (
CommandSender & sender,
const std::vector< std::string > & args
) override const
Executes the command, returning its success
Parameters:
sender
Source of the commandargs
Arguments passed to the command
Returns:
true if the execution was successful, otherwise false
Implements endstone::Command::execute
function getExecutor¶
Gets the CommandExecutor associated with this command
Returns:
CommandExecutor object linked to this command
function getPlugin¶
Gets the owner of this PluginCommand
Returns:
Plugin that owns this command
function setExecutor¶
inline virtual void endstone::PluginCommand::setExecutor (
std::shared_ptr< CommandExecutor > executor
)
Sets the CommandExecutor to run when parsing this command
Parameters:
executor
New executor to run
The documentation for this class was generated from the following file include/endstone/command/plugin_command.h