The Battle for Wesnoth  1.15.2+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:
Inheritance graph

Public Types

typedef map_command_handler< chat_command_handlermap
 
- Public Types inherited from events::map_command_handler< chat_command_handler >
typedef void(chat_command_handler ::* 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_req_arg ()
 
void do_room_query ()
 
void do_room_query_noarg ()
 
void do_gen_room_query ()
 
void do_whisper ()
 
void do_chanmsg ()
 
void do_log ()
 
void do_ignore ()
 
void do_friend ()
 
void do_remove ()
 
void do_display ()
 
void do_version ()
 
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 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 22 of file chat_command_handler.hpp.

Member Typedef Documentation

◆ map

Definition at line 25 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

Member Function Documentation

◆ do_chanmsg()

void events::chat_command_handler::do_chanmsg ( )
protected

◆ do_display()

void events::chat_command_handler::do_display ( )
protected

◆ do_emote()

void events::chat_command_handler::do_emote ( )
protected

◆ do_friend()

void events::chat_command_handler::do_friend ( )
protected

◆ do_gen_room_query()

void events::chat_command_handler::do_gen_room_query ( )
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_network_send()

void events::chat_command_handler::do_network_send ( )
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_room_query()

void events::chat_command_handler::do_room_query ( )
protected

◆ do_room_query_noarg()

void events::chat_command_handler::do_room_query_noarg ( )
protected

◆ do_version()

void events::chat_command_handler::do_version ( )
protected

Definition at line 157 of file chat_command_handler.cpp.

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

Referenced by chat_command_handler(), and 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 _(), c, is_enabled(), and print().

Referenced by events::console_handler::get_flags_description().

◆ 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 24 of file chat_command_handler.cpp.

References preferences::is_authenticated().

Referenced by get_command_flags_description().

◆ 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 134 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: