#include <multiplayer_connect.hpp>

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, config > | get_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 | |
| connect * | parent_ |
| 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_ |
Definition at line 53 of file multiplayer_connect.hpp.
Definition at line 66 of file multiplayer_connect.cpp.
References _, ai_algorithm_, allow_player_, cfg_, config::child(), config::child_range(), color_, game_config::color_info(), color_lock_, combo_color_, combo_faction_, combo_gender_, combo_leader_, combo_team_, controller_, DBG_MP, mp::connect::default_controller_, gui::widget::enable(), gui::slider::enable(), gui::button::enable(), enabled_, mp::connect::era_sides_, faction_, unit_type_data::find(), gui2::event::find(), mp::find_suitable_faction(), gender_, unit_type::get_gender_unit_type(), leader_list_manager::get_leader(), gold_lock_, config::has_attribute(), gui::widget::hide(), income_lock_, color_range::index(), init_ai_algorithm_combo(), label_gold_, label_income_, leader_, llm_, mp::connect::params_, parent_, leader_list_manager::set_color(), leader_list_manager::set_gender_combo(), gui::slider::set_increment(), gui::combo::set_items(), leader_list_manager::set_leader_combo(), gui::slider::set_max(), gui::widget::set_measurements(), gui::slider::set_min(), gui::combo::set_selected(), gui::slider::set_value(), slider_gold_, slider_income_, team_, team_lock_, mp::connect::team_names_, unit_type::type_name(), utils::unicode_em_dash, unit_types, update_faction_combo(), leader_list_manager::update_gender_list(), leader_list_manager::update_leader_list(), update_ui(), and mp_game_settings::use_map_settings.

| mp::connect::side::side | ( | const side & | a | ) |
Definition at line 294 of file multiplayer_connect.cpp.
References color_, combo_gender_, combo_leader_, enabled_, leader_list_manager::get_leader(), leader_, llm_, leader_list_manager::set_color(), leader_list_manager::set_gender_combo(), leader_list_manager::set_leader_combo(), and leader_list_manager::update_gender_list().

| void mp::connect::side::add_widgets_to_scrollpane | ( | gui::scrollpane & | pane, | |
| int | pos | |||
| ) |
Definition at line 326 of file multiplayer_connect.cpp.
References gui::scrollpane::add_widget(), combo_ai_algorithm_, combo_color_, combo_controller_, combo_faction_, combo_gender_, combo_leader_, combo_team_, gui::widget::height(), label_gold_, label_income_, orig_controller_, player_number_, slider_gold_, slider_income_, and gui::widget::width().

| 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().

| 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().

| 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().

| config mp::connect::side::get_config | ( | ) | const |
Gets a config object representing this side.
If include_leader is set to true, the config objects include the "type=" defining the leader type, else it does not.
Definition at line 602 of file multiplayer_connect.cpp.
References _, config::add_child(), ai_algorithm_, allow_changes_, allow_player_, config::append(), cfg_, mp::CNTR_COMPUTER, mp::CNTR_EMPTY, mp::CNTR_LAST, mp::CNTR_LOCAL, mp::CNTR_NETWORK, mp::CNTR_RESERVED, color_, controller_, current_player_, config::empty(), enabled_, mp::connect::era_sides_, faction_, mp_game_settings::fog_game, gender_, ai::configuration::get_ai_config_for(), leader_list_manager::get_gender(), leader_list_manager::get_leader(), gold_, config::has_attribute(), id_, income_, index_, leader_, llm_, preferences::login(), config::merge_with(), N_, mp::connect::params_, parent_, player_id_, config::remove_attribute(), mp_game_settings::share_maps, mp_game_settings::share_view, mp_game_settings::shroud_game, team_, mp::connect::team_names_, mp_game_settings::use_map_settings, mp::connect::user_team_names_, vgettext(), mp_game_settings::village_gold, and mp_game_settings::village_support.

| 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().

| 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().

| 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().

| 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_.

| void mp::connect::side::import_network_user | ( | const config & | data | ) |
Imports data from the network into this side, and updates the UI accordingly.
Definition at line 854 of file multiplayer_connect.cpp.
References mp::CNTR_RESERVED, combo_faction_, combo_gender_, combo_leader_, controller_, gui::widget::enabled(), enabled_, mp::connect::era_sides_, faction_, leader_list_manager::get_leader(), llm_, parent_, player_id_, leader_list_manager::set_gender(), leader_list_manager::set_leader(), set_ready_for_start(), leader_list_manager::update_gender_list(), leader_list_manager::update_leader_list(), and update_ui().
Referenced by mp::connect::take_reserved_side().


| 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().


| void mp::connect::side::process_event | ( | ) |
Definition at line 344 of file multiplayer_connect.cpp.
References _, ai_algorithm_, mp::connect::ai_algorithms_, gui::combo::changed(), changed_, mp::CNTR_LAST, color_, combo_ai_algorithm_, combo_color_, combo_controller_, combo_faction_, combo_gender_, combo_leader_, combo_team_, controller_, enabled_, faction_, leader_list_manager::get_leader(), gold_, income_, init_ai_algorithm_combo(), label_gold_, label_income_, llm_, mp::connect::local_only_, parent_, player_id_, ready_for_start_, save_id_, gui::combo::selected(), leader_list_manager::set_color(), set_controller(), leader_list_manager::set_gender_combo(), leader_list_manager::set_leader_combo(), set_player_id(), gui::label::set_text(), mp::connect::sides_, slider_gold_, slider_income_, str_cast(), team_, update_ai_algorithm_combo(), update_controller_ui(), update_faction_combo(), leader_list_manager::update_gender_list(), leader_list_manager::update_leader_list(), update_ui(), mp::connect::users_, and gui::slider::value().

| 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 | ) |
Resets this side to its default state, and updates the UI accordingly.
Definition at line 884 of file multiplayer_connect.cpp.
References mp::CNTR_NETWORK, mp::CNTR_RESERVED, combo_faction_, combo_gender_, combo_leader_, controller_, gui::widget::enabled(), enabled_, mp::connect::era_sides_, faction_, leader_list_manager::get_leader(), llm_, parent_, player_id_, ready_for_start_, leader_list_manager::update_gender_list(), leader_list_manager::update_leader_list(), and update_ui().

| void mp::connect::side::resolve_random | ( | ) |
Resolves the random leader / factions.
Definition at line 904 of file multiplayer_connect.cpp.
References _, enabled_, mp::connect::era_sides_, ERR_CF, error(), faction_, unit_race::FEMALE, unit_type_data::find(), gui2::event::find(), gender_, unit_type::genders(), leader_list_manager::get_gender(), leader_list_manager::get_leader(), leader_, llm_, unit_race::MALE, parent_, leader_list_manager::set_gender(), utils::split(), unit_types, and vgettext().

| 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().


| 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().


| 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().

| 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().

| 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().

| 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().


| 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().


| void mp::connect::side::update_ui | ( | ) | [private] |
Definition at line 578 of file multiplayer_connect.cpp.
References _, color_, combo_color_, combo_faction_, combo_team_, faction_, gold_, income_, label_gold_, label_income_, gui::combo::selected(), gui::combo::set_selected(), gui::label::set_text(), gui::slider::set_value(), slider_gold_, slider_income_, str_cast(), team_, and update_controller_ui().
Referenced by import_network_user(), process_event(), reset(), set_controller(), set_player_id(), and side().


| 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_.

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().
bool mp::connect::side::allow_changes_ [private] |
Definition at line 193 of file multiplayer_connect.hpp.
Referenced by get_config().
bool mp::connect::side::allow_player_ [private] |
Definition at line 192 of file multiplayer_connect.hpp.
Referenced by allow_player(), available(), get_config(), ready_for_start(), and side().
config mp::connect::side::cfg_ [private] |
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().
bool mp::connect::side::changed_ [private] |
Definition at line 195 of file multiplayer_connect.hpp.
Referenced by changed(), and process_event().
int mp::connect::side::color_ [private] |
Definition at line 163 of file multiplayer_connect.hpp.
Referenced by get_config(), process_event(), side(), update_faction_combo(), and update_ui().
bool mp::connect::side::color_lock_ [private] |
Definition at line 175 of file multiplayer_connect.hpp.
Referenced by side().
Definition at line 181 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), hide_ai_algorithm_combo(), init_ai_algorithm_combo(), and process_event().
gui::combo mp::connect::side::combo_color_ [private] |
Definition at line 186 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().
Definition at line 179 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), process_event(), update_controller_ui(), and update_user_list().
gui::combo mp::connect::side::combo_faction_ [private] |
Definition at line 182 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), import_network_user(), process_event(), reset(), side(), update_faction_combo(), and update_ui().
gui::combo mp::connect::side::combo_gender_ [private] |
Definition at line 184 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), import_network_user(), process_event(), reset(), and side().
gui::combo mp::connect::side::combo_leader_ [private] |
Definition at line 183 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), import_network_user(), process_event(), reset(), and side().
gui::combo mp::connect::side::combo_team_ [private] |
Definition at line 185 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().
mp::controller mp::connect::side::controller_ [private] |
Definition at line 160 of file multiplayer_connect.hpp.
Referenced by available(), get_config(), get_controller(), hide_ai_algorithm_combo(), import_network_user(), process_event(), ready_for_start(), reset(), set_controller(), set_player_id(), side(), and update_controller_ui().
std::string mp::connect::side::current_player_ [private] |
Definition at line 159 of file multiplayer_connect.hpp.
Referenced by available(), and get_config().
bool mp::connect::side::enabled_ [private] |
Definition at line 194 of file multiplayer_connect.hpp.
Referenced by get_config(), import_network_user(), process_event(), reset(), resolve_random(), and side().
int mp::connect::side::faction_ [private] |
Definition at line 161 of file multiplayer_connect.hpp.
Referenced by get_config(), import_network_user(), process_event(), reset(), resolve_random(), side(), update_faction_combo(), and update_ui().
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().
bool mp::connect::side::gold_lock_ [private] |
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().
int mp::connect::side::income_ [private] |
Definition at line 165 of file multiplayer_connect.hpp.
Referenced by get_config(), process_event(), and update_ui().
bool mp::connect::side::income_lock_ [private] |
Definition at line 173 of file multiplayer_connect.hpp.
Referenced by side().
int mp::connect::side::index_ [private] |
Definition at line 155 of file multiplayer_connect.hpp.
Referenced by get_config(), get_index(), and set_index().
gui::label mp::connect::side::label_gold_ [private] |
Definition at line 189 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().
gui::label mp::connect::side::label_income_ [private] |
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().
leader_list_manager mp::connect::side::llm_ [private] |
Definition at line 196 of file multiplayer_connect.hpp.
Referenced by get_config(), import_network_user(), process_event(), reset(), resolve_random(), and side().
Definition at line 180 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), and hide_ai_algorithm_combo().
connect* mp::connect::side::parent_ [private] |
The mp::connect widget owning this mp::connect::side.
Used in the constructor, must be first.
Definition at line 145 of file multiplayer_connect.hpp.
Referenced by get_config(), import_network_user(), init_ai_algorithm_combo(), process_event(), reset(), resolve_random(), set_player_id(), side(), update_controller_ui(), update_faction_combo(), and update_user_list().
std::string mp::connect::side::player_id_ [private] |
Definition at line 157 of file multiplayer_connect.hpp.
Referenced by available(), get_config(), get_player_id(), import_network_user(), process_event(), reset(), set_controller(), set_player_id(), update_controller_ui(), and update_user_list().
gui::label mp::connect::side::player_number_ [private] |
Definition at line 178 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane().
bool mp::connect::side::ready_for_start_ [private] |
Definition at line 169 of file multiplayer_connect.hpp.
Referenced by process_event(), ready_for_start(), reset(), and set_ready_for_start().
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().
gui::slider mp::connect::side::slider_gold_ [private] |
Definition at line 187 of file multiplayer_connect.hpp.
Referenced by add_widgets_to_scrollpane(), process_event(), side(), and update_ui().
gui::slider mp::connect::side::slider_income_ [private] |
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().
bool mp::connect::side::team_lock_ [private] |
Definition at line 174 of file multiplayer_connect.hpp.
Referenced by side().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:24:49 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |