The Battle for Wesnoth  1.19.0-dev
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
events::chat_command_handler Class Reference

#include <chat_command_handler.hpp>

Inheritance diagram for events::chat_command_handler:

Public Types

typedef map_command_handler< chat_command_handlermap
 
- Public Types inherited from events::map_command_handler< chat_command_handler >
typedef void(Worker::* command_handler) ()
 
typedef std::map< std::string, command > command_map
 
typedef std::map< std::string, std::string > command_alias_map
 

Public Member Functions

 chat_command_handler (chat_handler &chathandler, bool allies_only)
 
- Public Member Functions inherited from events::map_command_handler< chat_command_handler >
 map_command_handler ()
 
virtual ~map_command_handler ()
 
bool empty () const
 
void dispatch (std::string cmd)
 
std::vector< std::string > get_commands_list () const
 
void command_failed (const std::string &message, bool=false)
 

Protected Member Functions

void do_emote ()
 
void do_network_send ()
 
void do_network_send (const std::string &data)
 
void do_network_send_req_arg ()
 
void do_whisper ()
 
void do_log ()
 
void do_ignore ()
 
void do_friend ()
 
void do_remove ()
 
void do_display ()
 
void do_version ()
 
void do_clear_messages ()
 
void do_mp_report ()
 
void do_info ()
 Request information about a user from the server. More...
 
std::string get_flags_description () const
 
std::string get_command_flags_description (const map_command_handler< chat_command_handler >::command &c) const
 
bool is_enabled (const map_command_handler< chat_command_handler >::command &c) const
 
void print (const std::string &title, const std::string &message)
 
void init_map ()
 
- Protected Member Functions inherited from events::map_command_handler< chat_command_handler >
void init_map_default ()
 
virtual std::string get_command_flags_description (const command &) const
 
virtual bool is_enabled (const command &) const
 
virtual void parse_cmd (const std::string &cmd_string)
 
virtual std::string get_arg (unsigned argn) const
 
virtual std::string get_data (unsigned argn=1) const
 
virtual std::string get_cmd () const
 
void command_failed_need_arg (int argn)
 
void print_usage ()
 
std::string get_actual_cmd (const std::string &cmd) const
 
const command * get_command (const std::string &cmd) const
 
command * get_command (const std::string &cmd)
 
void help ()
 
bool help_command (const std::string &acmd)
 
virtual void register_command (const std::string &cmd, command_handler h, const std::string &help="", const std::string &usage="", const std::string &flags="")
 
virtual void register_alias (const std::string &to_cmd, const std::string &cmd)
 

Private Attributes

chat_handlerchat_handler_
 
bool allies_only_
 

Additional Inherited Members

- Static Protected Member Functions inherited from events::map_command_handler< chat_command_handler >
static void set_help_on_unknown (bool value)
 
static void set_cmd_prefix (const std::string &value)
 
static void set_cmd_flag (bool value)
 
static const std::vector< std::string > get_aliases (const std::string &cmd)
 
- Protected Attributes inherited from events::map_command_handler< chat_command_handler >
cmd_arg_parser cap_
 

Detailed Description

Definition at line 23 of file chat_command_handler.hpp.

Member Typedef Documentation

◆ map

Definition at line 26 of file chat_command_handler.hpp.

Constructor & Destructor Documentation

◆ chat_command_handler()

events::chat_command_handler::chat_command_handler ( chat_handler chathandler,
bool  allies_only 
)
inline

Definition at line 27 of file chat_command_handler.hpp.

Member Function Documentation

◆ do_clear_messages()

void events::chat_command_handler::do_clear_messages ( )
protected

Definition at line 143 of file chat_command_handler.cpp.

References chat_handler_, and events::chat_handler::clear_messages().

Referenced by init_map().

◆ do_display()

void events::chat_command_handler::do_display ( )
protected

Definition at line 120 of file chat_command_handler.cpp.

References preferences::VIEW_FRIENDS.

Referenced by do_friend(), and do_ignore().

◆ do_emote()

void events::chat_command_handler::do_emote ( )
protected

◆ do_friend()

void events::chat_command_handler::do_friend ( )
protected

◆ do_ignore()

void events::chat_command_handler::do_ignore ( )
protected

◆ do_info()

void events::chat_command_handler::do_info ( )
protected

◆ do_log()

void events::chat_command_handler::do_log ( )
protected

◆ do_mp_report()

void events::chat_command_handler::do_mp_report ( )
protected

Definition at line 147 of file chat_command_handler.cpp.

References do_network_send().

Referenced by init_map().

◆ do_network_send() [1/2]

void events::chat_command_handler::do_network_send ( )
protected

◆ do_network_send() [2/2]

void events::chat_command_handler::do_network_send ( const std::string &  data)
protected

◆ do_network_send_req_arg()

void events::chat_command_handler::do_network_send_req_arg ( )
protected

◆ do_remove()

void events::chat_command_handler::do_remove ( )
protected

◆ do_version()

void events::chat_command_handler::do_version ( )
protected

Definition at line 125 of file chat_command_handler.cpp.

References _(), print(), and game_config::revision.

Referenced by init_map().

◆ do_whisper()

void events::chat_command_handler::do_whisper ( )
protected

◆ get_command_flags_description()

std::string events::chat_command_handler::get_command_flags_description ( const map_command_handler< chat_command_handler >::command &  c) const
inlineprotected

Definition at line 54 of file chat_command_handler.hpp.

References _(), and c.

◆ get_flags_description()

std::string events::chat_command_handler::get_flags_description ( ) const
inlineprotectedvirtual

Reimplemented from events::map_command_handler< chat_command_handler >.

Reimplemented in events::console_handler.

Definition at line 50 of file chat_command_handler.hpp.

References _().

◆ init_map()

void events::chat_command_handler::init_map ( )
inlineprotectedvirtual

◆ is_enabled()

bool events::chat_command_handler::is_enabled ( const map_command_handler< chat_command_handler >::command &  c) const
protected

Definition at line 27 of file chat_command_handler.cpp.

References c, and mp::logged_in_as_moderator().

◆ print()

void events::chat_command_handler::print ( const std::string &  title,
const std::string &  message 
)
protectedvirtual

Member Data Documentation

◆ allies_only_

bool events::chat_command_handler::allies_only_
private

Definition at line 125 of file chat_command_handler.hpp.

Referenced by do_emote().

◆ chat_handler_

chat_handler& events::chat_command_handler::chat_handler_
private

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