The Battle for Wesnoth  1.19.7+dev
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
display_chat_manager Class Reference

#include <display_chat_manager.hpp>

Classes

struct  chat_message
 

Public Member Functions

 display_chat_manager (display &disp)
 
void add_observer (const std::string &name)
 
void remove_observer (const std::string &name)
 
const std::set< std::string > & observers () const
 
void add_whisperer (const std::string &nick)
 
void remove_whisperer (const std::string &nick)
 
const std::set< std::string > & whisperers () const
 
void add_chat_message (const std::time_t &time, const std::string &speaker, int side, const std::string &msg, events::chat_handler::MESSAGE_TYPE type, bool bell)
 
void clear_chat_messages ()
 

Private Member Functions

void prune_chat_messages (bool remove_all=false)
 

Private Attributes

std::set< std::string > observers_
 
std::set< std::string > whisperers_
 
std::vector< chat_messagechat_messages_
 
displaymy_disp_
 

Friends

class game_display
 

Detailed Description

Definition at line 28 of file display_chat_manager.hpp.

Constructor & Destructor Documentation

◆ display_chat_manager()

display_chat_manager::display_chat_manager ( display disp)
inline

Definition at line 30 of file display_chat_manager.hpp.

Member Function Documentation

◆ add_chat_message()

void display_chat_manager::add_chat_message ( const std::time_t &  time,
const std::string &  speaker,
int  side,
const std::string &  msg,
events::chat_handler::MESSAGE_TYPE  type,
bool  bell 
)

◆ add_observer()

void display_chat_manager::add_observer ( const std::string &  name)
inline

Definition at line 32 of file display_chat_manager.hpp.

References observers_.

Referenced by playmp_controller::process_network_data_impl().

◆ add_whisperer()

void display_chat_manager::add_whisperer ( const std::string &  nick)
inline

Definition at line 36 of file display_chat_manager.hpp.

References whisperers_.

Referenced by add_chat_message().

◆ clear_chat_messages()

void display_chat_manager::clear_chat_messages ( )
inline

Definition at line 42 of file display_chat_manager.hpp.

References prune_chat_messages().

Referenced by game_lua_kernel::intf_clear_messages().

◆ observers()

const std::set<std::string>& display_chat_manager::observers ( ) const
inline

Definition at line 34 of file display_chat_manager.hpp.

References observers_.

◆ prune_chat_messages()

void display_chat_manager::prune_chat_messages ( bool  remove_all = false)
private

◆ remove_observer()

void display_chat_manager::remove_observer ( const std::string &  name)
inline

Definition at line 33 of file display_chat_manager.hpp.

References observers_.

Referenced by playmp_controller::process_network_data_impl().

◆ remove_whisperer()

void display_chat_manager::remove_whisperer ( const std::string &  nick)
inline

Definition at line 37 of file display_chat_manager.hpp.

References whisperers_.

Referenced by add_chat_message().

◆ whisperers()

const std::set<std::string>& display_chat_manager::whisperers ( ) const
inline

Definition at line 38 of file display_chat_manager.hpp.

References whisperers_.

Referenced by add_chat_message().

Friends And Related Function Documentation

◆ game_display

friend class game_display
friend

Definition at line 44 of file display_chat_manager.hpp.

Member Data Documentation

◆ chat_messages_

std::vector<chat_message> display_chat_manager::chat_messages_
private

Definition at line 60 of file display_chat_manager.hpp.

Referenced by add_chat_message(), and prune_chat_messages().

◆ my_disp_

display& display_chat_manager::my_disp_
private

Definition at line 62 of file display_chat_manager.hpp.

Referenced by add_chat_message().

◆ observers_

std::set<std::string> display_chat_manager::observers_
private

Definition at line 46 of file display_chat_manager.hpp.

Referenced by add_observer(), observers(), and remove_observer().

◆ whisperers_

std::set<std::string> display_chat_manager::whisperers_
private

Definition at line 47 of file display_chat_manager.hpp.

Referenced by add_whisperer(), remove_whisperer(), and whisperers().


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