The Battle for Wesnoth  1.19.0-dev
Classes | Public Member Functions | Private Attributes | List of all members
gui2::lobby_player_list_helper Class Reference

#include <lobby_player_list_helper.hpp>

Classes

struct  sub_list
 

Public Member Functions

void init (window &w)
 
void update (const std::vector< mp::user_info > &user_info, int focused_game)
 Updates the tree contents based on the given user data. More...
 
 lobby_player_list_helper (decltype(user_callback) ucb)
 
const mp::user_infoget_selected_info () const
 

Private Attributes

std::array< sub_list, 3 > player_lists
 Main subsections of the player tree. More...
 
tree_viewtree
 The parent tree. More...
 
std::function< void(const mp::user_info *)> user_callback
 The double click callback bound to each player's tree node. More...
 
std::map< const tree_view_node *, const mp::user_info * > info_map
 Node-to-info mappings for easy access. More...
 

Detailed Description

Definition at line 35 of file lobby_player_list_helper.hpp.

Constructor & Destructor Documentation

◆ lobby_player_list_helper()

gui2::lobby_player_list_helper::lobby_player_list_helper ( decltype(user_callback ucb)
inline

Definition at line 69 of file lobby_player_list_helper.hpp.

Member Function Documentation

◆ get_selected_info()

const mp::user_info * gui2::lobby_player_list_helper::get_selected_info ( ) const

◆ init()

void gui2::lobby_player_list_helper::init ( window w)

Definition at line 167 of file lobby_player_list_helper.cpp.

References _(), player_lists, tree, and w.

Referenced by gui2::dialogs::mp_lobby::pre_show().

◆ update()

void gui2::lobby_player_list_helper::update ( const std::vector< mp::user_info > &  user_info,
int  focused_game 
)

Member Data Documentation

◆ info_map

std::map<const tree_view_node*, const mp::user_info*> gui2::lobby_player_list_helper::info_map
private

Node-to-info mappings for easy access.

Definition at line 66 of file lobby_player_list_helper.hpp.

Referenced by get_selected_info(), and update().

◆ player_lists

std::array<sub_list, 3> gui2::lobby_player_list_helper::player_lists
private

Main subsections of the player tree.

This should never change at runtime so the number is hardcoded.

Definition at line 57 of file lobby_player_list_helper.hpp.

Referenced by init(), and update().

◆ tree

tree_view* gui2::lobby_player_list_helper::tree
private

The parent tree.

Definition at line 60 of file lobby_player_list_helper.hpp.

Referenced by get_selected_info(), init(), and update().

◆ user_callback

std::function<void(const mp::user_info*)> gui2::lobby_player_list_helper::user_callback
private

The double click callback bound to each player's tree node.

Definition at line 63 of file lobby_player_list_helper.hpp.

Referenced by update().


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