TrinityCore
Loading...
Searching...
No Matches
Trinity::Impl::ChatCommands::ChatCommandNode Class Reference

#include <ChatCommand.h>

Public Member Functions

 ChatCommandNode ()=default
 
 ~ChatCommandNode ()=default
 

Static Public Member Functions

static void LoadCommandMap ()
 
static void InvalidateCommandMap ()
 
static bool TryExecuteCommand (ChatHandler &handler, std::string_view cmd)
 
static void SendCommandHelpFor (ChatHandler &handler, std::string_view cmd)
 
static std::vector< std::string > GetAutoCompletionsFor (ChatHandler const &handler, std::string_view cmd)
 

Private Types

using ChatCommandBuilder = Trinity::ChatCommands::ChatCommandBuilder
 

Private Member Functions

void LoadFromBuilder (ChatCommandBuilder const &builder)
 
 ChatCommandNode (ChatCommandNode const &other)=delete
 
 ChatCommandNode (ChatCommandNode &&other) noexcept=default
 
ChatCommandNode & operator= (ChatCommandNode const &other)=delete
 
ChatCommandNode & operator= (ChatCommandNode &&other) noexcept=default
 
void ResolveNames (std::string name)
 
void SendCommandHelp (ChatHandler &handler) const
 
bool IsVisible (ChatHandler const &who) const
 
bool IsInvokerVisible (ChatHandler const &who) const
 
bool HasVisibleSubCommands (ChatHandler const &who) const
 

Static Private Member Functions

static std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > const & GetTopLevelMap ()
 
static void LoadCommandsIntoMap (ChatCommandNode *blank, std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > &map, std::span< ChatCommandBuilder const > commands)
 

Private Attributes

std::string _name
 
CommandInvoker _invoker
 
CommandPermissions _permission
 
std::variant< std::monostate, TrinityStrings, std::string > _help
 
std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > _subCommands
 

Friends

struct FilteredCommandListIterator
 

Detailed Description

Definition at line 177 of file ChatCommand.h.

Member Typedef Documentation

◆ ChatCommandBuilder

Constructor & Destructor Documentation

◆ ChatCommandNode() [1/3]

Trinity::Impl::ChatCommands::ChatCommandNode::ChatCommandNode ( )
default

◆ ~ChatCommandNode()

Trinity::Impl::ChatCommands::ChatCommandNode::~ChatCommandNode ( )
default

◆ ChatCommandNode() [2/3]

Trinity::Impl::ChatCommands::ChatCommandNode::ChatCommandNode ( ChatCommandNode const &  other)
privatedelete

◆ ChatCommandNode() [3/3]

Trinity::Impl::ChatCommands::ChatCommandNode::ChatCommandNode ( ChatCommandNode &&  other)
privatedefaultnoexcept

Member Function Documentation

◆ GetAutoCompletionsFor()

std::vector< std::string > Trinity::Impl::ChatCommands::ChatCommandNode::GetAutoCompletionsFor ( ChatHandler const &  handler,
std::string_view  cmd 
)
static

◆ GetTopLevelMap()

ChatSubCommandMap const & Trinity::Impl::ChatCommands::ChatCommandNode::GetTopLevelMap ( )
staticprivate

Definition at line 80 of file ChatCommand.cpp.

References COMMAND_MAP.

◆ HasVisibleSubCommands()

bool Trinity::Impl::ChatCommands::ChatCommandNode::HasVisibleSubCommands ( ChatHandler const &  who) const
private

Definition at line 481 of file ChatCommand.cpp.

Referenced by IsVisible().

◆ InvalidateCommandMap()

void Trinity::Impl::ChatCommands::ChatCommandNode::InvalidateCommandMap ( )
static

Definition at line 86 of file ChatCommand.cpp.

References COMMAND_MAP.

Referenced by Trinity::ChatCommands::InvalidateCommandMap().

◆ IsInvokerVisible()

bool Trinity::Impl::ChatCommands::ChatCommandNode::IsInvokerVisible ( ChatHandler const &  who) const
private

◆ IsVisible()

bool Trinity::Impl::ChatCommands::ChatCommandNode::IsVisible ( ChatHandler const &  who) const
inlineprivate

Definition at line 205 of file ChatCommand.h.

References HasVisibleSubCommands(), and IsInvokerVisible().

◆ LoadCommandMap()

void Trinity::Impl::ChatCommands::ChatCommandNode::LoadCommandMap ( )
static

◆ LoadCommandsIntoMap()

void Trinity::Impl::ChatCommands::ChatCommandNode::LoadCommandsIntoMap ( ChatCommandNode *  blank,
std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > &  map,
std::span< ChatCommandBuilder const >  commands 
)
staticprivate

◆ LoadFromBuilder()

◆ operator=() [1/2]

ChatCommandNode & Trinity::Impl::ChatCommands::ChatCommandNode::operator= ( ChatCommandNode &&  other)
privatedefaultnoexcept

◆ operator=() [2/2]

ChatCommandNode & Trinity::Impl::ChatCommands::ChatCommandNode::operator= ( ChatCommandNode const &  other)
privatedelete

◆ ResolveNames()

void Trinity::Impl::ChatCommands::ChatCommandNode::ResolveNames ( std::string  name)
private

Definition at line 135 of file ChatCommand.cpp.

References Trinity::Impl::ChatCommands::COMMAND_DELIMITER, and TC_LOG_WARN.

◆ SendCommandHelp()

void Trinity::Impl::ChatCommands::ChatCommandNode::SendCommandHelp ( ChatHandler &  handler) const
private

◆ SendCommandHelpFor()

◆ TryExecuteCommand()

Friends And Related Symbol Documentation

◆ FilteredCommandListIterator

friend struct FilteredCommandListIterator
friend

Definition at line 179 of file ChatCommand.h.

Member Data Documentation

◆ _help

std::variant<std::monostate, TrinityStrings, std::string> Trinity::Impl::ChatCommands::ChatCommandNode::_help
private

Definition at line 212 of file ChatCommand.h.

Referenced by LoadCommandMap(), and LoadFromBuilder().

◆ _invoker

CommandInvoker Trinity::Impl::ChatCommands::ChatCommandNode::_invoker
private

Definition at line 210 of file ChatCommand.h.

Referenced by LoadFromBuilder(), and TryExecuteCommand().

◆ _name

std::string Trinity::Impl::ChatCommands::ChatCommandNode::_name
private

Definition at line 209 of file ChatCommand.h.

Referenced by SendCommandHelpFor(), and TryExecuteCommand().

◆ _permission

CommandPermissions Trinity::Impl::ChatCommands::ChatCommandNode::_permission
private

Definition at line 211 of file ChatCommand.h.

Referenced by LoadFromBuilder(), and TryExecuteCommand().

◆ _subCommands

std::map<std::string_view, ChatCommandNode, StringCompareLessI_T> Trinity::Impl::ChatCommands::ChatCommandNode::_subCommands
private

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