Class endstone::CommandSender¶
ClassList > endstone > CommandSender
Represents a command sender.
#include <endstone/command/command_sender.h>
Inherits the following classes: endstone::Permissible
Inherited by the following classes: endstone::Actor, endstone::ConsoleCommandSender
Public Functions¶
| Type | Name | 
|---|---|
| CommandSender () = default | 
|
| virtual CommandSender * | asCommandSender () override const Casts a Permissible asCommandSender .  | 
| virtual ConsoleCommandSender * | asConsole () const Gets a CommandSender as Console.  | 
| virtual Player * | asPlayer () const Gets a CommandSender asPlayer .  | 
| virtual std::string | getName () const = 0 Gets the name of this command sender.  | 
| virtual Server & | getServer () const = 0 Returns the server instance that this command is running on.  | 
| virtual void | sendErrorMessage (const std::string & message) const = 0 Sends this sender a error message.  | 
| virtual void | sendErrorMessage (const Translatable & message) const = 0 Sends this sender a translatable error message.  | 
| void | sendErrorMessage (const fmt::format_string< Args... > format, Args &&... args) const | 
| virtual void | sendMessage (const std::string & message) const = 0 Sends this sender a message.  | 
| virtual void | sendMessage (const Translatable & message) const = 0 Sends this sender a translatable message.  | 
| void | sendMessage (const fmt::format_string< Args... > format, Args &&... args) const | 
| ~CommandSender () override | 
Public Functions inherited from endstone::Permissible¶
| Type | Name | 
|---|---|
| virtual PermissionAttachment * | addAttachment (Plugin & plugin, const std::string & name, bool value) = 0 | 
| virtual PermissionAttachment * | addAttachment (Plugin & plugin) = 0 | 
| virtual CommandSender * | asCommandSender () const = 0 | 
| virtual std::unordered_set< PermissionAttachmentInfo * > | getEffectivePermissions () const = 0 | 
| virtual bool | hasPermission (std::string name) const = 0 | 
| virtual bool | hasPermission (const Permission & perm) const = 0 | 
| virtual bool | isOp () const = 0 Checks if this object is a server operator.  | 
| virtual bool | isPermissionSet (std::string name) const = 0 | 
| virtual bool | isPermissionSet (const Permission & perm) const = 0 | 
| virtual void | recalculatePermissions () = 0 | 
| virtual bool | removeAttachment (PermissionAttachment & attachment) = 0 | 
| virtual void | setOp (bool value) = 0 Sets the operator status of this object.  | 
| virtual | ~Permissible () = default | 
Public Functions Documentation¶
function CommandSender¶
function asCommandSender¶
Casts a Permissible asCommandSender .
Returns:
CommandSender, nullptr if not a CommandSender
Implements endstone::Permissible::asCommandSender
function asConsole¶
Gets a CommandSender as Console.
Returns:
CommandSender, nullptr if not a Console
function asPlayer¶
Gets a CommandSender asPlayer .
Returns:
Player, nullptr if not a Player
function getName¶
Gets the name of this command sender.
Returns:
Name of the sender
function getServer¶
Returns the server instance that this command is running on.
Returns:
Server instance
function sendErrorMessage [⅓]¶
Sends this sender a error message.
Parameters:
messageError message to be displayed
function sendErrorMessage [⅔]¶
Sends this sender a translatable error message.
Parameters:
messageError message to be displayed
function sendErrorMessage [3/3]¶
template<typename... Args>
inline void endstone::CommandSender::sendErrorMessage (
    const fmt::format_string< Args... > format,
    Args &&... args
) const
function sendMessage [⅓]¶
Sends this sender a message.
Parameters:
messageMessage to be displayed
function sendMessage [⅔]¶
Sends this sender a translatable message.
Parameters:
messageMessage to be displayed
function sendMessage [3/3]¶
template<typename... Args>
inline void endstone::CommandSender::sendMessage (
    const fmt::format_string< Args... > format,
    Args &&... args
) const
function ~CommandSender¶
The documentation for this class was generated from the following file include/endstone/command/command_sender.h