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
 
ChatCommandNodeoperator= (ChatCommandNode const &other)=delete
 
ChatCommandNodeoperator= (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 178 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

Definition at line 385 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTopLevelMap()

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

Definition at line 80 of file ChatCommand.cpp.

◆ HasVisibleSubCommands()

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

Definition at line 481 of file ChatCommand.cpp.

+ Here is the caller graph for this function:

◆ InvalidateCommandMap()

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

Definition at line 86 of file ChatCommand.cpp.

+ Here is the caller graph for this function:

◆ IsInvokerVisible()

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

Definition at line 472 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsVisible()

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

Definition at line 206 of file ChatCommand.h.

+ Here is the call graph for this function:

◆ LoadCommandMap()

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

Definition at line 87 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadCommandsIntoMap()

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

Definition at line 58 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadFromBuilder()

void Trinity::Impl::ChatCommands::ChatCommandNode::LoadFromBuilder ( ChatCommandBuilder const &  builder)
private

Definition at line 32 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

◆ SendCommandHelp()

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

Definition at line 182 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendCommandHelpFor()

void Trinity::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor ( ChatHandler handler,
std::string_view  cmd 
)
static

Definition at line 323 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryExecuteCommand()

bool Trinity::Impl::ChatCommands::ChatCommandNode::TryExecuteCommand ( ChatHandler handler,
std::string_view  cmd 
)
static

Definition at line 256 of file ChatCommand.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ FilteredCommandListIterator

friend struct FilteredCommandListIterator
friend

Definition at line 180 of file ChatCommand.h.

Member Data Documentation

◆ _help

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

Definition at line 213 of file ChatCommand.h.

◆ _invoker

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

Definition at line 211 of file ChatCommand.h.

◆ _name

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

Definition at line 210 of file ChatCommand.h.

◆ _permission

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

Definition at line 212 of file ChatCommand.h.

◆ _subCommands

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

Definition at line 214 of file ChatCommand.h.


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