Public Member Functions | Private Member Functions | Private Attributes

mp::connect::side Class Reference

#include <multiplayer_connect.hpp>

Collaboration diagram for mp::connect::side:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 side (connect &parent, const config &cfg, int index)
 side (const side &a)
void add_widgets_to_scrollpane (gui::scrollpane &pane, int pos)
void process_event ()
bool changed ()
 Returns true if this side changed since last call to changed().
config get_config () const
 Gets a config object representing this side.
bool available (const std::string &name="") const
 Returns true if this side is waiting for a network player and players allowed.
bool ready_for_start () const
 Returns true, if the player has chosen his leader and this side is ready for the game to start.
bool allow_player () const
 Return true if players are allowed to take this side.
void set_controller (mp::controller controller)
 Sets the controller of a side.
mp::controller get_controller () const
void update_user_list ()
 Adds an user to the user list combo.
const std::string & get_current_player () const
 Returns the username of this side.
int get_index ()
void set_index (int index)
const std::string & get_player_id () const
void set_player_id (const std::string &player_id)
 Sets the username of this side.
void set_ready_for_start (bool ready_for_start)
 Sets if the joining player has chosen his leader.
int get_team ()
void set_team (int team)
std::vector< std::string > get_children_to_swap ()
std::map< std::string, configget_side_children ()
void set_side_children (std::map< std::string, config > children)
void import_network_user (const config &data)
 Imports data from the network into this side, and updates the UI accordingly.
void reset (mp::controller controller)
 Resets this side to its default state, and updates the UI accordingly.
void resolve_random ()
 Resolves the random leader / factions.
void hide_ai_algorithm_combo (bool invis)

Private Member Functions

void init_ai_algorithm_combo ()
void update_ai_algorithm_combo ()
void update_faction_combo ()
 Fill or refresh the faction combo using the proper team color.
void update_controller_ui ()
void update_ui ()

Private Attributes

connectparent_
 The mp::connect widget owning this mp::connect::side.
config cfg_
 A non-const config.
int index_
std::string id_
std::string player_id_
std::string save_id_
std::string current_player_
mp::controller controller_
int faction_
int team_
int color_
int gold_
int income_
std::string leader_
std::string gender_
std::string ai_algorithm_
bool ready_for_start_
bool gold_lock_
bool income_lock_
bool team_lock_
bool color_lock_
gui::label player_number_
gui::combo_drag_ptr combo_controller_
gui::label orig_controller_
gui::combo combo_ai_algorithm_
gui::combo combo_faction_
gui::combo combo_leader_
gui::combo combo_gender_
gui::combo combo_team_
gui::combo combo_color_
gui::slider slider_gold_
gui::slider slider_income_
gui::label label_gold_
gui::label label_income_
bool allow_player_
bool allow_changes_
bool enabled_
bool changed_
leader_list_manager llm_

Detailed Description

Definition at line 53 of file multiplayer_connect.hpp.


Constructor & Destructor Documentation

mp::connect::side::side ( connect parent,
const config cfg,
int  index 
)
mp::connect::side::side ( const side a  ) 

Member Function Documentation

void mp::connect::side::add_widgets_to_scrollpane ( gui::scrollpane pane,
int  pos 
)
bool mp::connect::side::allow_player (  )  const

Return true if players are allowed to take this side.

Definition at line 491 of file multiplayer_connect.cpp.

References allow_player_.

Referenced by mp::connect::can_start_game().

Here is the caller graph for this function:

bool mp::connect::side::available ( const std::string &  name = ""  )  const

Returns true if this side is waiting for a network player and players allowed.

Definition at line 478 of file multiplayer_connect.cpp.

References allow_player_, mp::CNTR_NETWORK, mp::CNTR_RESERVED, controller_, current_player_, and player_id_.

Referenced by mp::connect::take_reserved_side().

Here is the caller graph for this function:

bool mp::connect::side::changed (  ) 

Returns true if this side changed since last call to changed().

Definition at line 456 of file multiplayer_connect.cpp.

References changed_.

std::vector< std::string > mp::connect::side::get_children_to_swap (  ) 

Definition at line 816 of file multiplayer_connect.cpp.

Referenced by get_side_children(), and set_side_children().

Here is the caller graph for this function:

config mp::connect::side::get_config (  )  const
mp::controller mp::connect::side::get_controller (  )  const

Definition at line 749 of file multiplayer_connect.cpp.

References controller_.

Referenced by mp::connect::can_start_game().

Here is the caller graph for this function:

const std::string& mp::connect::side::get_current_player (  )  const [inline]

Returns the username of this side.

Definition at line 94 of file multiplayer_connect.hpp.

Referenced by mp::connect::take_reserved_side().

Here is the caller graph for this function:

int mp::connect::side::get_index (  ) 

Definition at line 781 of file multiplayer_connect.cpp.

References index_.

const std::string & mp::connect::side::get_player_id (  )  const

Definition at line 791 of file multiplayer_connect.cpp.

References player_id_.

std::map< std::string, config > mp::connect::side::get_side_children (  ) 

Definition at line 827 of file multiplayer_connect.cpp.

References cfg_, config::child_range(), and get_children_to_swap().

Here is the call graph for this function:

int mp::connect::side::get_team (  ) 

Definition at line 806 of file multiplayer_connect.cpp.

References team_.

void mp::connect::side::hide_ai_algorithm_combo ( bool  invis  ) 

Definition at line 515 of file multiplayer_connect.cpp.

References mp::CNTR_COMPUTER, combo_ai_algorithm_, controller_, gui::widget::hide(), and orig_controller_.

Here is the call graph for this function:

void mp::connect::side::import_network_user ( const config data  ) 
void mp::connect::side::init_ai_algorithm_combo (  )  [private]

Definition at line 534 of file multiplayer_connect.cpp.

References ai_algorithm_, mp::connect::ai_algorithms_, combo_ai_algorithm_, ai::description::id, parent_, gui::combo::set_items(), gui::combo::set_selected(), and ai::description::text.

Referenced by process_event(), and side().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::connect::side::process_event (  ) 
bool mp::connect::side::ready_for_start (  )  const

Returns true, if the player has chosen his leader and this side is ready for the game to start.

Definition at line 463 of file multiplayer_connect.cpp.

References allow_player_, mp::CNTR_COMPUTER, mp::CNTR_EMPTY, mp::CNTR_LOCAL, controller_, and ready_for_start_.

void mp::connect::side::reset ( mp::controller  controller  ) 
void mp::connect::side::resolve_random (  ) 
void mp::connect::side::set_controller ( mp::controller  controller  ) 

Sets the controller of a side.

Definition at line 741 of file multiplayer_connect.cpp.

References controller_, player_id_, and update_ui().

Referenced by process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::connect::side::set_index ( int  index  ) 

Definition at line 786 of file multiplayer_connect.cpp.

References index_.

void mp::connect::side::set_player_id ( const std::string &  player_id  ) 

Sets the username of this side.

Definition at line 796 of file multiplayer_connect.cpp.

References controller_, mp::connect::find_player(), parent_, player_id_, update_ui(), and mp::connect::users_.

Referenced by process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::connect::side::set_ready_for_start ( bool  ready_for_start  ) 

Sets if the joining player has chosen his leader.

Definition at line 849 of file multiplayer_connect.cpp.

References ready_for_start_.

Referenced by import_network_user().

Here is the caller graph for this function:

void mp::connect::side::set_side_children ( std::map< std::string, config children  ) 

Definition at line 838 of file multiplayer_connect.cpp.

References config::add_child(), cfg_, config::clear_children(), and get_children_to_swap().

Here is the call graph for this function:

void mp::connect::side::set_team ( int  team  ) 

Definition at line 811 of file multiplayer_connect.cpp.

References team_.

void mp::connect::side::update_ai_algorithm_combo (  )  [inline, private]

Definition at line 133 of file multiplayer_connect.hpp.

Referenced by process_event(), and update_controller_ui().

Here is the caller graph for this function:

void mp::connect::side::update_controller_ui (  )  [private]

Definition at line 496 of file multiplayer_connect.cpp.

References mp::CNTR_LAST, mp::CNTR_NETWORK, combo_controller_, controller_, mp::connect::find_player(), mp::connect::local_only_, parent_, player_id_, save_id_, update_ai_algorithm_combo(), and mp::connect::users_.

Referenced by process_event(), update_ui(), and update_user_list().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::connect::side::update_faction_combo (  )  [private]

Fill or refresh the faction combo using the proper team color.

Definition at line 557 of file multiplayer_connect.cpp.

References color_, COLUMN_SEPARATOR, combo_faction_, mp::connect::era_sides_, faction_, IMAGE_PREFIX, parent_, gui::combo::set_items(), and gui::combo::set_selected().

Referenced by process_event(), and side().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::connect::side::update_ui (  )  [private]
void mp::connect::side::update_user_list (  ) 

Adds an user to the user list combo.

Definition at line 754 of file multiplayer_connect.cpp.

References _, combo_controller_, parent_, player_id_, mp::connect::player_types_, save_id_, update_controller_ui(), and mp::connect::users_.

Here is the call graph for this function:


Member Data Documentation

std::string mp::connect::side::ai_algorithm_ [private]

Definition at line 168 of file multiplayer_connect.hpp.

Referenced by get_config(), init_ai_algorithm_combo(), process_event(), and side().

Definition at line 193 of file multiplayer_connect.hpp.

Referenced by get_config().

Definition at line 192 of file multiplayer_connect.hpp.

Referenced by allow_player(), available(), get_config(), ready_for_start(), and side().

A non-const config.

Be careful not to insert keys when only reading.

(Use cfg_.get_attribute().)

Definition at line 152 of file multiplayer_connect.hpp.

Referenced by get_config(), get_side_children(), set_side_children(), and side().

Definition at line 195 of file multiplayer_connect.hpp.

Referenced by changed(), and process_event().

Definition at line 175 of file multiplayer_connect.hpp.

Referenced by side().

Definition at line 186 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().

Definition at line 185 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().

std::string mp::connect::side::current_player_ [private]

Definition at line 159 of file multiplayer_connect.hpp.

Referenced by available(), and get_config().

std::string mp::connect::side::gender_ [private]

Definition at line 167 of file multiplayer_connect.hpp.

Referenced by get_config(), resolve_random(), and side().

int mp::connect::side::gold_ [private]

Definition at line 164 of file multiplayer_connect.hpp.

Referenced by get_config(), process_event(), and update_ui().

Definition at line 172 of file multiplayer_connect.hpp.

Referenced by side().

std::string mp::connect::side::id_ [private]

Definition at line 156 of file multiplayer_connect.hpp.

Referenced by get_config().

Definition at line 165 of file multiplayer_connect.hpp.

Referenced by get_config(), process_event(), and update_ui().

Definition at line 173 of file multiplayer_connect.hpp.

Referenced by side().

Definition at line 155 of file multiplayer_connect.hpp.

Referenced by get_config(), get_index(), and set_index().

Definition at line 189 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().

Definition at line 190 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().

std::string mp::connect::side::leader_ [private]

Definition at line 166 of file multiplayer_connect.hpp.

Referenced by get_config(), resolve_random(), and side().

Definition at line 180 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), and hide_ai_algorithm_combo().

std::string mp::connect::side::player_id_ [private]

Definition at line 178 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane().

std::string mp::connect::side::save_id_ [private]

Definition at line 158 of file multiplayer_connect.hpp.

Referenced by process_event(), update_controller_ui(), and update_user_list().

Definition at line 187 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().

Definition at line 188 of file multiplayer_connect.hpp.

Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().

int mp::connect::side::team_ [private]

Definition at line 162 of file multiplayer_connect.hpp.

Referenced by get_config(), get_team(), process_event(), set_team(), side(), and update_ui().

Definition at line 174 of file multiplayer_connect.hpp.

Referenced by side().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:24:49 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs