The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
lobby_info Class Reference

This class represents the collective information the client has about the players and games on the server. More...

#include <info.hpp>

Public Types

typedef std::map< int,
game_info * > 
game_info_map
 

Public Member Functions

 lobby_info (const config &game_config, twesnothd_connection &)
 
 ~lobby_info ()
 
void delete_games ()
 
void process_gamelist (const config &data)
 Process a full gamelist. More...
 
bool process_gamelist_diff (const config &data)
 Process a gamelist diff. More...
 
void sync_games_display_status ()
 
void make_games_vector ()
 
const configgamelist () const
 
void clear_game_filter ()
 
void add_game_filter (game_filter_base *f)
 
void set_game_filter_invert (bool value)
 
void apply_game_filter ()
 
game_infoget_game_by_id (int id)
 
const game_infoget_game_by_id (int id) const
 
void sort_users (bool by_name, bool by_relation)
 
void open_room (const std::string &name)
 
void close_room (const std::string &name)
 
bool has_room (const std::string &name) const
 
room_infoget_room (const std::string &name)
 
const room_infoget_room (const std::string &name) const
 
user_infoget_user (const std::string &name)
 
chat_logget_whisper_log (const std::string &name)
 
void update_user_statuses (int game_id, const room_info *room)
 
const std::vector< room_info > & rooms () const
 
const std::vector< game_info * > & games () const
 
const std::vector< bool > & games_visibility () const
 
const std::vector< game_info * > & games_filtered () const
 
const std::vector< user_info > & users () const
 
const std::vector< user_info * > & users_sorted () const
 

Private Member Functions

void process_userlist ()
 

Private Attributes

const configgame_config_
 
config gamelist_
 
bool gamelist_initialized_
 
std::vector< room_inforooms_
 
game_info_map games_by_id_
 
std::vector< game_info * > games_
 
std::vector< game_info * > games_filtered_
 
std::vector< user_infousers_
 
std::vector< user_info * > users_sorted_
 
std::map< std::string, chat_logwhispers_
 
game_filter_and_stack game_filter_
 
bool game_filter_invert_
 
std::vector< bool > games_visibility_
 
twesnothd_connectionwesnothd_connection_
 

Detailed Description

This class represents the collective information the client has about the players and games on the server.

Definition at line 25 of file info.hpp.

Member Typedef Documentation

Definition at line 34 of file info.hpp.

Constructor & Destructor Documentation

lobby_info::lobby_info ( const config game_config,
twesnothd_connection wesnothd_connection 
)
explicit

Definition at line 41 of file info.cpp.

lobby_info::~lobby_info ( )

Definition at line 59 of file info.cpp.

References delete_games().

Member Function Documentation

void lobby_info::add_game_filter ( game_filter_base f)

Definition at line 306 of file info.cpp.

References game_filter_stack::append(), and game_filter_.

Referenced by gui2::tlobby_main::game_filter_reload().

void lobby_info::apply_game_filter ( )
void lobby_info::clear_game_filter ( )

Definition at line 311 of file info.cpp.

References game_filter_stack::clear(), and game_filter_.

Referenced by gui2::tlobby_main::game_filter_reload().

void lobby_info::close_room ( const std::string name)

Definition at line 291 of file info.cpp.

References DBG_LB, get_room(), and rooms_.

Referenced by gui2::tlobby_main::close_window().

void lobby_info::delete_games ( )

Definition at line 64 of file info.cpp.

References games_by_id_.

Referenced by process_gamelist(), and ~lobby_info().

const config& lobby_info::gamelist ( ) const
inline

Definition at line 52 of file info.hpp.

References gamelist_.

const std::vector<game_info*>& lobby_info::games ( ) const
inline
const std::vector< game_info * > & lobby_info::games_filtered ( ) const

Definition at line 301 of file info.cpp.

References games_filtered_.

Referenced by gui2::tlobby_main::update_gamelist_header().

const std::vector<bool>& lobby_info::games_visibility ( ) const
inline
game_info * lobby_info::get_game_by_id ( int  id)

Definition at line 242 of file info.cpp.

References games_by_id_, and i.

Referenced by gui2::tlobby_player_info::pre_show(), and process_userlist().

const game_info * lobby_info::get_game_by_id ( int  id) const

Definition at line 248 of file info.cpp.

References games_by_id_, and i.

room_info * lobby_info::get_room ( const std::string name)
const room_info * lobby_info::get_room ( const std::string name) const

Definition at line 264 of file info.cpp.

References rooms_.

user_info& lobby_info::get_user ( const std::string name)
chat_log & lobby_info::get_whisper_log ( const std::string name)
bool lobby_info::has_room ( const std::string name) const

Definition at line 274 of file info.cpp.

References get_room().

Referenced by open_room().

void lobby_info::make_games_vector ( )
void lobby_info::open_room ( const std::string name)

Definition at line 284 of file info.cpp.

References has_room(), and rooms_.

Referenced by gui2::tlobby_main::process_room_join(), and gui2::tlobby_main::search_create_window().

void lobby_info::process_gamelist ( const config data)

Process a full gamelist.

Current info is discarded.

Definition at line 102 of file info.cpp.

References config::child(), config::child_range(), DBG_LB, delete_games(), game_config_, gamelist_, gamelist_initialized_, games_by_id_, game_info::id, process_userlist(), and SCOPE_LB.

Referenced by gui2::tlobby_main::process_gamelist().

bool lobby_info::process_gamelist_diff ( const config data)
void lobby_info::process_userlist ( )
private
const std::vector<room_info>& lobby_info::rooms ( ) const
inline

Definition at line 79 of file info.hpp.

References rooms_.

void lobby_info::set_game_filter_invert ( bool  value)

Definition at line 316 of file info.cpp.

References game_filter_invert_.

Referenced by gui2::tlobby_main::game_filter_reload().

void lobby_info::sort_users ( bool  by_name,
bool  by_relation 
)

Definition at line 396 of file info.cpp.

References sort(), users_, and users_sorted_.

Referenced by gui2::tlobby_main::update_playerlist().

void lobby_info::sync_games_display_status ( )
void lobby_info::update_user_statuses ( int  game_id,
const room_info room 
)

Definition at line 350 of file info.cpp.

References users_.

Referenced by gui2::tlobby_main::update_playerlist().

const std::vector<user_info>& lobby_info::users ( ) const
inline
const std::vector< user_info * > & lobby_info::users_sorted ( ) const

Definition at line 420 of file info.cpp.

References users_sorted_.

Referenced by gui2::tlobby_main::update_playerlist().

Member Data Documentation

const config& lobby_info::game_config_
private

Definition at line 101 of file info.hpp.

Referenced by process_gamelist(), and process_gamelist_diff().

game_filter_and_stack lobby_info::game_filter_
private

Definition at line 113 of file info.hpp.

Referenced by add_game_filter(), apply_game_filter(), and clear_game_filter().

bool lobby_info::game_filter_invert_
private

Definition at line 114 of file info.hpp.

Referenced by apply_game_filter(), and set_game_filter_invert().

config lobby_info::gamelist_
private

Definition at line 102 of file info.hpp.

Referenced by gamelist(), process_gamelist(), process_gamelist_diff(), and process_userlist().

bool lobby_info::gamelist_initialized_
private

Definition at line 103 of file info.hpp.

Referenced by process_gamelist(), and process_gamelist_diff().

std::vector<game_info*> lobby_info::games_
private

Definition at line 108 of file info.hpp.

Referenced by apply_game_filter(), games(), and make_games_vector().

game_info_map lobby_info::games_by_id_
private
std::vector<game_info*> lobby_info::games_filtered_
private

Definition at line 109 of file info.hpp.

Referenced by apply_game_filter(), games_filtered(), and make_games_vector().

std::vector<bool> lobby_info::games_visibility_
private

Definition at line 115 of file info.hpp.

Referenced by apply_game_filter(), games_visibility(), and make_games_vector().

std::vector<room_info> lobby_info::rooms_
private

Definition at line 104 of file info.hpp.

Referenced by close_room(), get_room(), open_room(), and rooms().

std::vector<user_info> lobby_info::users_
private

Definition at line 110 of file info.hpp.

Referenced by process_userlist(), sort_users(), update_user_statuses(), and users().

std::vector<user_info*> lobby_info::users_sorted_
private

Definition at line 111 of file info.hpp.

Referenced by sort_users(), and users_sorted().

twesnothd_connection& lobby_info::wesnothd_connection_
private

Definition at line 116 of file info.hpp.

Referenced by process_gamelist_diff().

std::map<std::string, chat_log> lobby_info::whispers_
private

Definition at line 112 of file info.hpp.

Referenced by get_whisper_log().


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