This class represents the collective information the client has about the players and games on the server. More...
#include <lobby_info.hpp>

Public Types | |
| typedef std::map< int, game_info * > | game_info_map |
Public Member Functions | |
| lobby_info (const config &game_config) | |
| ~lobby_info () | |
| void | delete_games () |
| void | process_gamelist (const config &data) |
| Process a full gamelist. | |
| bool | process_gamelist_diff (const config &data) |
| Process a gamelist diff. | |
| void | sync_games_display_status () |
| void | make_games_vector () |
| const config & | gamelist () 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_info * | get_game_by_id (int id) |
| const game_info * | get_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_info * | get_room (const std::string &name) |
| const room_info * | get_room (const std::string &name) const |
| user_info & | get_user (const std::string &name) |
| chat_log & | get_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 config & | game_config_ |
| config | gamelist_ |
| bool | gamelist_initialized_ |
| std::vector< room_info > | rooms_ |
| game_info_map | games_by_id_ |
| std::vector< game_info * > | games_ |
| std::vector< game_info * > | games_filtered_ |
| std::vector< user_info > | users_ |
| std::vector< user_info * > | users_sorted_ |
| std::map< std::string, chat_log > | whispers_ |
| game_filter_and_stack | game_filter_ |
| bool | game_filter_invert_ |
| std::vector< bool > | games_visibility_ |
This class represents the collective information the client has about the players and games on the server.
Definition at line 26 of file lobby_info.hpp.
| typedef std::map<int, game_info*> lobby_info::game_info_map |
Definition at line 35 of file lobby_info.hpp.
| lobby_info::lobby_info | ( | const config & | game_config | ) | [explicit] |
Definition at line 45 of file lobby_info.cpp.
| lobby_info::~lobby_info | ( | ) |
Definition at line 62 of file lobby_info.cpp.
References delete_games().

| void lobby_info::add_game_filter | ( | game_filter_base * | f | ) |
Definition at line 284 of file lobby_info.cpp.
References game_filter_stack::append(), and game_filter_.
Referenced by gui2::tlobby_main::game_filter_reload().


| void lobby_info::apply_game_filter | ( | ) |
Definition at line 309 of file lobby_info.cpp.
References game_filter_, game_filter_invert_, games_, games_filtered_, games_visibility_, game_filter_and_stack::match(), and gui2::tip::show().
Referenced by gui2::tlobby_main::update_gamelist(), gui2::tlobby_main::update_gamelist_diff(), and gui2::tlobby_main::update_gamelist_filter().


| void lobby_info::clear_game_filter | ( | ) |
Definition at line 289 of file lobby_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 269 of file lobby_info.cpp.
References DBG_LB, get_room(), and rooms_.
Referenced by gui2::tlobby_main::close_window().


| void lobby_info::delete_games | ( | ) |
Definition at line 67 of file lobby_info.cpp.
References games_by_id_.
Referenced by process_gamelist(), and ~lobby_info().

| const config& lobby_info::gamelist | ( | ) | const [inline] |
Definition at line 53 of file lobby_info.hpp.
References gamelist_.
| const std::vector<game_info*>& lobby_info::games | ( | ) | const [inline] |
Definition at line 78 of file lobby_info.hpp.
References games_.
Referenced by gui2::tlobby_main::do_game_join(), gui2::tlobby_main::join_or_observe(), gui2::tlobby_main::update_gamelist(), gui2::tlobby_main::update_gamelist_diff(), gui2::tlobby_main::update_gamelist_filter(), gui2::tlobby_main::update_gamelist_header(), and gui2::tlobby_main::update_selected_game().

| const std::vector< game_info * > & lobby_info::games_filtered | ( | ) | const |
Definition at line 279 of file lobby_info.cpp.
References games_filtered_.
Referenced by gui2::tlobby_main::update_gamelist_header().

| const std::vector<bool>& lobby_info::games_visibility | ( | ) | const [inline] |
Definition at line 79 of file lobby_info.hpp.
References games_visibility_.
Referenced by gui2::tlobby_main::update_gamelist(), gui2::tlobby_main::update_gamelist_diff(), and gui2::tlobby_main::update_gamelist_filter().

| game_info * lobby_info::get_game_by_id | ( | int | id | ) |
Definition at line 224 of file lobby_info.cpp.
References games_by_id_.
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 230 of file lobby_info.cpp.
References games_by_id_.
| room_info * lobby_info::get_room | ( | const std::string & | name | ) |
Definition at line 236 of file lobby_info.cpp.
References room_info::name(), and rooms_.
Referenced by gui2::tlobby_main::active_window_room(), gui2::tlobby_main::add_chat_room_message_received(), gui2::tlobby_main::add_chat_room_message_sent(), close_room(), has_room(), gui2::tlobby_main::process_room_join(), gui2::tlobby_main::process_room_part(), and gui2::tlobby_main::process_room_query_response().


| const room_info * lobby_info::get_room | ( | const std::string & | name | ) | const |
Definition at line 244 of file lobby_info.cpp.
References room_info::name(), and rooms_.

| user_info& lobby_info::get_user | ( | const std::string & | name | ) |
| chat_log & lobby_info::get_whisper_log | ( | const std::string & | name | ) |
Definition at line 257 of file lobby_info.cpp.
References whispers_.
Referenced by gui2::tlobby_main::add_whisper_received(), gui2::tlobby_main::add_whisper_sent(), and gui2::tlobby_main::close_window().

| bool lobby_info::has_room | ( | const std::string & | name | ) | const |
Definition at line 252 of file lobby_info.cpp.
References get_room().
Referenced by open_room().


| void lobby_info::make_games_vector | ( | ) |
Definition at line 299 of file lobby_info.cpp.
References games_, games_by_id_, games_filtered_, and games_visibility_.
Referenced by sync_games_display_status(), gui2::tlobby_main::update_gamelist(), and gui2::tlobby_main::update_gamelist_diff().

| void lobby_info::open_room | ( | const std::string & | name | ) |
Definition at line 262 of file lobby_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 99 of file lobby_info.cpp.
References config::child(), config::child_range(), DBG_LB, delete_games(), game_config_, gamelist_, gamelist_initialized_, games_by_id_, game_info::id, and process_userlist().
Referenced by gui2::tlobby_main::process_gamelist().


| bool lobby_info::process_gamelist_diff | ( | const config & | data | ) |
Process a gamelist diff.
Definition at line 116 of file lobby_info.cpp.
References config::apply_diff(), config::child(), config::child_range(), config::clear_diff_track(), DBG_LB, config::diff_track_attribute, ERR_LB, game_config_, gamelist_, gamelist_initialized_, games_by_id_, game::error::message, game_info::NEW, process_userlist(), network::send_data(), and WRN_LB.
Referenced by gui2::tlobby_main::process_gamelist_diff().


| void lobby_info::process_userlist | ( | ) | [private] |
Definition at line 179 of file lobby_info.cpp.
References config::child_range(), user_info::FRIEND, user_info::game_id, gamelist_, get_game_by_id(), game_info::has_friends, game_info::has_ignored, user_info::IGNORED, user_info::name, user_info::relation, users_, and WRN_NG.
Referenced by process_gamelist(), and process_gamelist_diff().


| const std::vector<room_info>& lobby_info::rooms | ( | ) | const [inline] |
Definition at line 77 of file lobby_info.hpp.
References rooms_.
| void lobby_info::set_game_filter_invert | ( | bool | value | ) |
Definition at line 294 of file lobby_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 365 of file lobby_info.cpp.
References sort(), users_, and users_sorted_.
Referenced by gui2::tlobby_main::update_playerlist().


| void lobby_info::sync_games_display_status | ( | ) |
Definition at line 207 of file lobby_info.cpp.
References DBG_LB, game_info::DELETED, games_by_id_, and make_games_vector().
Referenced by gui2::tlobby_main::update_gamelist(), and gui2::tlobby_main::update_gamelist_diff().


| void lobby_info::update_user_statuses | ( | int | game_id, | |
| const room_info * | room | |||
| ) |
Definition at line 326 of file lobby_info.cpp.
References user_info::update_state(), and users_.
Referenced by gui2::tlobby_main::update_playerlist().


| const std::vector<user_info>& lobby_info::users | ( | ) | const [inline] |
Definition at line 81 of file lobby_info.hpp.
References users_.
Referenced by gui2::tlobby_main::chat_input_keypress_callback(), and gui2::tlobby_main::update_playerlist().

| const std::vector< user_info * > & lobby_info::users_sorted | ( | ) | const |
Definition at line 382 of file lobby_info.cpp.
References users_sorted_.
Referenced by gui2::tlobby_main::update_playerlist().

const config& lobby_info::game_config_ [private] |
Definition at line 86 of file lobby_info.hpp.
Referenced by process_gamelist(), and process_gamelist_diff().
Definition at line 98 of file lobby_info.hpp.
Referenced by add_game_filter(), apply_game_filter(), and clear_game_filter().
bool lobby_info::game_filter_invert_ [private] |
Definition at line 99 of file lobby_info.hpp.
Referenced by apply_game_filter(), and set_game_filter_invert().
config lobby_info::gamelist_ [private] |
Definition at line 87 of file lobby_info.hpp.
Referenced by gamelist(), process_gamelist(), process_gamelist_diff(), and process_userlist().
bool lobby_info::gamelist_initialized_ [private] |
Definition at line 88 of file lobby_info.hpp.
Referenced by process_gamelist(), and process_gamelist_diff().
std::vector<game_info*> lobby_info::games_ [private] |
Definition at line 93 of file lobby_info.hpp.
Referenced by apply_game_filter(), games(), and make_games_vector().
game_info_map lobby_info::games_by_id_ [private] |
Definition at line 91 of file lobby_info.hpp.
Referenced by delete_games(), get_game_by_id(), make_games_vector(), process_gamelist(), process_gamelist_diff(), and sync_games_display_status().
std::vector<game_info*> lobby_info::games_filtered_ [private] |
Definition at line 94 of file lobby_info.hpp.
Referenced by apply_game_filter(), games_filtered(), and make_games_vector().
std::vector<bool> lobby_info::games_visibility_ [private] |
Definition at line 100 of file lobby_info.hpp.
Referenced by apply_game_filter(), games_visibility(), and make_games_vector().
std::vector<room_info> lobby_info::rooms_ [private] |
Definition at line 89 of file lobby_info.hpp.
Referenced by close_room(), get_room(), open_room(), and rooms().
std::vector<user_info> lobby_info::users_ [private] |
Definition at line 95 of file lobby_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 96 of file lobby_info.hpp.
Referenced by sort_users(), and users_sorted().
std::map<std::string, chat_log> lobby_info::whispers_ [private] |
Definition at line 97 of file lobby_info.hpp.
Referenced by get_whisper_log().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:14:27 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |