#include <connect_engine.hpp>
Private Member Functions | |
side_engine (const side_engine &engine) | |
void | operator= (const side_engine &) |
void | add_controller_option (ng::controller controller, const std::string &name, const std::string &controller_value) |
Private Attributes | |
config | cfg_ |
connect_engine & | parent_ |
ng::controller | controller_ |
unsigned | current_controller_index_ |
std::vector< controller_option > | controller_options_ |
const bool | allow_player_ |
const bool | controller_lock_ |
int | index_ |
int | team_ |
int | color_ |
int | gold_ |
int | income_ |
std::string | reserved_for_ |
std::string | player_id_ |
std::string | ai_algorithm_ |
bool | chose_random_ |
bool | disallow_shuffle_ |
flg_manager | flg_ |
const bool | allow_changes_ |
bool | waiting_to_choose_faction_ |
std::string | custom_color_ |
Definition at line 139 of file connect_engine.hpp.
ng::side_engine::side_engine | ( | const config & | cfg, |
connect_engine & | parent_engine, | ||
const int | index | ||
) |
Definition at line 867 of file connect_engine.cpp.
References config::add_child(), ai_algorithm_, allow_player_, cfg_, config::child(), saved_game::classification(), ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_NETWORK, ng::CNTR_RESERVED, color_, custom_color_, ng::connect_engine::default_controller_, config::empty(), ERR_MP, ng::connect_engine::params_, parent_, config::remove_attribute(), reserved_for_, mp_game_settings::saved_game, ng::depcheck::SCENARIO, ng::connect_engine::scenario(), set_controller(), ng::connect_engine::side_engines(), ng::connect_engine::state_, team_, ng::connect_engine::team_names_, update_controller_options(), and WRN_MP.
ng::side_engine::~side_engine | ( | ) |
Definition at line 976 of file connect_engine.cpp.
|
private |
|
private |
Definition at line 1348 of file connect_engine.cpp.
References cfg_, controller_lock_, and controller_options_.
Referenced by update_controller_options().
|
inline |
Definition at line 211 of file connect_engine.hpp.
References ai_algorithm_.
Referenced by set_ai_algorithm().
|
inline |
Definition at line 215 of file connect_engine.hpp.
References allow_changes_.
|
inline |
Definition at line 214 of file connect_engine.hpp.
References allow_player_.
|
inline |
Definition at line 218 of file connect_engine.hpp.
References disallow_shuffle_.
bool ng::side_engine::available_for_user | ( | const std::string & | name = "" | ) | const |
Definition at line 1155 of file connect_engine.cpp.
References ng::CNTR_NETWORK, ng::CNTR_RESERVED, controller_, player_id_, and reserved_for_.
Referenced by ready_for_start().
|
inline |
Definition at line 190 of file connect_engine.hpp.
References cfg_.
|
inline |
Definition at line 201 of file connect_engine.hpp.
References color_.
Referenced by get_color(), and set_color().
|
inline |
Definition at line 191 of file connect_engine.hpp.
References controller_.
Referenced by set_controller().
bool ng::side_engine::controller_changed | ( | const int | selection | ) |
Definition at line 1301 of file connect_engine.cpp.
References ng::CNTR_LAST, controller_options_, ng::connect_engine::default_controller_, parent_, player_id_, set_controller(), and set_waiting_to_choose_status().
|
inline |
Definition at line 188 of file connect_engine.hpp.
References controller_options_.
|
inline |
Definition at line 192 of file connect_engine.hpp.
References current_controller_index_.
|
inline |
Definition at line 221 of file connect_engine.hpp.
References flg_.
std::vector< std::string > ng::side_engine::get_children_to_swap | ( | ) |
Definition at line 369 of file connect_engine.cpp.
Referenced by get_side_children(), and set_side_children().
std::string ng::side_engine::get_color | ( | int | index = -1 | ) | const |
Definition at line 1369 of file connect_engine.cpp.
References color(), and custom_color_.
Referenced by get_colors(), and new_config().
std::vector< std::string > ng::side_engine::get_colors | ( | ) | const |
Definition at line 1360 of file connect_engine.cpp.
References get_color(), mp::get_color_string(), i, and num_colors().
std::multimap< std::string, config > ng::side_engine::get_side_children | ( | ) |
Definition at line 380 of file connect_engine.cpp.
References cfg_, config::child_range(), and get_children_to_swap().
|
inline |
|
inline |
|
inline |
config ng::side_engine::new_config | ( | ) | const |
Definition at line 997 of file connect_engine.cpp.
References _(), config::add_child_at(), ai_algorithm_, allow_changes_, allow_player_, config::append(), cfg_, config::child_range(), chose_random_, config::clear(), ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LAST, ng::CNTR_LOCAL, ng::CNTR_RESERVED, color_, controller_, ng::flg_manager::current_faction(), ng::flg_manager::current_gender(), ng::flg_manager::current_leader(), ng::flg_manager::default_leader_cfg(), config::empty(), flg_, get_color(), gold_, config::has_attribute(), income_, index_, preferences::login(), config::merge_with(), ng::connect_engine::params_, parent_, player_id_, config::remove_attribute(), config::remove_attributes(), reserved_for_, mp_game_settings::saved_game, team_, ng::connect_engine::team_names_, mp_game_settings::use_map_settings, user_description(), ng::connect_engine::user_team_names_, and vgettext().
int ng::side_engine::num_colors | ( | ) | const |
Definition at line 1383 of file connect_engine.cpp.
References custom_color_, and gamemap::MAX_PLAYERS.
Referenced by get_colors().
|
private |
void ng::side_engine::place_user | ( | const std::string & | name | ) |
Definition at line 1232 of file connect_engine.cpp.
Referenced by swap_sides_on_drop_target().
Definition at line 1240 of file connect_engine.cpp.
References ng::connect_engine::default_controller_, flg_, parent_, player_id_, set_controller(), ng::flg_manager::set_current_faction(), ng::flg_manager::set_current_gender(), ng::flg_manager::set_current_leader(), and waiting_to_choose_faction_.
|
inline |
Definition at line 207 of file connect_engine.hpp.
References player_id_.
|
inline |
Definition at line 219 of file connect_engine.hpp.
References parent_, and ng::connect_engine::player_teams_.
|
inline |
Definition at line 186 of file connect_engine.hpp.
bool ng::side_engine::ready_for_start | ( | ) | const |
Definition at line 1125 of file connect_engine.cpp.
References allow_changes_, allow_player_, available_for_user(), ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LOCAL, ng::CNTR_NETWORK, controller_, preferences::login(), player_id_, and waiting_to_choose_faction_.
|
inline |
Definition at line 208 of file connect_engine.hpp.
References reserved_for_.
Referenced by set_reserved_for().
void ng::side_engine::reset | ( | ) |
Definition at line 1221 of file connect_engine.cpp.
References ng::connect_engine::default_controller_, flg_, ng::connect_engine::params_, parent_, player_id_, mp_game_settings::saved_game, set_controller(), ng::flg_manager::set_current_faction(), and set_waiting_to_choose_status().
void ng::side_engine::resolve_random | ( | rand_rng::mt_rng & | rng, |
const std::vector< std::string > & | avoid_faction_ids = std::vector<std::string>() |
||
) |
Definition at line 1206 of file connect_engine.cpp.
References chose_random_, ng::flg_manager::current_faction(), ng::flg_manager::current_gender(), ng::flg_manager::current_leader(), flg_, index_, ng::flg_manager::is_random_faction(), LOG_MP, ng::connect_engine::params_, parent_, ng::flg_manager::resolve_random(), and mp_game_settings::saved_game.
|
inline |
Definition at line 183 of file connect_engine.hpp.
References cfg_.
Referenced by previous_save_id().
|
inline |
Definition at line 212 of file connect_engine.hpp.
References ai_algorithm(), and ai_algorithm_.
Definition at line 202 of file connect_engine.hpp.
void ng::side_engine::set_controller | ( | ng::controller | controller | ) |
Definition at line 1322 of file connect_engine.cpp.
References controller(), controller_, and update_current_controller_index().
Referenced by controller_changed(), place_user(), reset(), set_controller_commandline(), side_engine(), and swap_sides_on_drop_target().
void ng::side_engine::set_controller_commandline | ( | const std::string & | controller_name | ) |
Definition at line 1334 of file connect_engine.cpp.
References ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LOCAL, player_id_, and set_controller().
void ng::side_engine::set_faction_commandline | ( | const std::string & | faction_name | ) |
Definition at line 1329 of file connect_engine.cpp.
References flg_, and ng::flg_manager::set_current_faction().
Definition at line 204 of file connect_engine.hpp.
Definition at line 206 of file connect_engine.hpp.
Definition at line 195 of file connect_engine.hpp.
|
inline |
Definition at line 209 of file connect_engine.hpp.
References reserved_for(), and reserved_for_.
void ng::side_engine::set_side_children | ( | std::multimap< std::string, config > | children | ) |
Definition at line 393 of file connect_engine.cpp.
References config::add_child(), cfg_, config::clear_children(), and get_children_to_swap().
Definition at line 197 of file connect_engine.hpp.
|
inline |
Definition at line 217 of file connect_engine.hpp.
References waiting_to_choose_faction_.
Referenced by controller_changed(), and reset().
bool ng::side_engine::swap_sides_on_drop_target | ( | const unsigned | drop_target | ) |
Definition at line 1173 of file connect_engine.cpp.
References ai_algorithm_, controller_, controller_lock_, controller_options_, parent_, place_user(), player_id_, set_controller(), and ng::connect_engine::side_engines_.
|
inline |
void ng::side_engine::update_controller_options | ( | ) |
Definition at line 1256 of file connect_engine.cpp.
References _(), add_controller_option(), ng::connect_engine::campaign_info_, ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LAST, ng::CNTR_LOCAL, ng::CNTR_NETWORK, ng::CNTR_RESERVED, ng::connect_engine::connected_users(), controller_options_, ng::connect_engine::default_controller_, parent_, reserved_for_, and update_current_controller_index().
Referenced by side_engine().
void ng::side_engine::update_current_controller_index | ( | ) |
Definition at line 1281 of file connect_engine.cpp.
References controller_, controller_options_, current_controller_index_, i, and player_id_.
Referenced by set_controller(), and update_controller_options().
std::string ng::side_engine::user_description | ( | ) | const |
Definition at line 980 of file connect_engine.cpp.
References ai_algorithm_, allow_player_, ng::CNTR_COMPUTER, ng::CNTR_LOCAL, controller_, ai::configuration::get_ai_config_for(), and N_.
Referenced by new_config().
|
inline |
Definition at line 216 of file connect_engine.hpp.
References waiting_to_choose_faction_.
|
private |
Definition at line 255 of file connect_engine.hpp.
Referenced by ai_algorithm(), new_config(), set_ai_algorithm(), side_engine(), swap_sides_on_drop_target(), and user_description().
|
private |
Definition at line 260 of file connect_engine.hpp.
Referenced by allow_changes(), new_config(), and ready_for_start().
|
private |
Definition at line 240 of file connect_engine.hpp.
Referenced by allow_player(), new_config(), ready_for_start(), side_engine(), and user_description().
|
private |
Definition at line 233 of file connect_engine.hpp.
Referenced by add_controller_option(), cfg(), get_side_children(), new_config(), previous_save_id(), save_id(), set_side_children(), and side_engine().
|
private |
Definition at line 257 of file connect_engine.hpp.
Referenced by new_config(), and resolve_random().
|
private |
Definition at line 245 of file connect_engine.hpp.
Referenced by color(), new_config(), set_color(), and side_engine().
|
private |
Definition at line 236 of file connect_engine.hpp.
Referenced by available_for_user(), controller(), new_config(), ready_for_start(), set_controller(), swap_sides_on_drop_target(), update_current_controller_index(), and user_description().
|
private |
Definition at line 241 of file connect_engine.hpp.
Referenced by add_controller_option(), and swap_sides_on_drop_target().
|
private |
Definition at line 238 of file connect_engine.hpp.
Referenced by add_controller_option(), controller_changed(), controller_options(), swap_sides_on_drop_target(), update_controller_options(), and update_current_controller_index().
|
private |
Definition at line 237 of file connect_engine.hpp.
Referenced by current_controller_index(), and update_current_controller_index().
|
private |
Definition at line 262 of file connect_engine.hpp.
Referenced by get_color(), num_colors(), and side_engine().
|
private |
Definition at line 258 of file connect_engine.hpp.
Referenced by allow_shuffle().
|
private |
Definition at line 259 of file connect_engine.hpp.
Referenced by flg(), new_config(), place_user(), reset(), resolve_random(), and set_faction_commandline().
|
private |
Definition at line 246 of file connect_engine.hpp.
Referenced by gold(), new_config(), and set_gold().
|
private |
Definition at line 247 of file connect_engine.hpp.
Referenced by income(), new_config(), and set_income().
|
private |
Definition at line 243 of file connect_engine.hpp.
Referenced by index(), new_config(), resolve_random(), and set_index().
|
private |
Definition at line 234 of file connect_engine.hpp.
Referenced by controller_changed(), new_config(), place_user(), player_teams(), reset(), resolve_random(), side_engine(), swap_sides_on_drop_target(), and update_controller_options().
|
private |
Definition at line 254 of file connect_engine.hpp.
Referenced by available_for_user(), controller_changed(), new_config(), place_user(), player_id(), ready_for_start(), reset(), set_controller_commandline(), swap_sides_on_drop_target(), and update_current_controller_index().
|
private |
Definition at line 253 of file connect_engine.hpp.
Referenced by available_for_user(), new_config(), reserved_for(), set_reserved_for(), side_engine(), and update_controller_options().
|
private |
Definition at line 244 of file connect_engine.hpp.
Referenced by new_config(), set_team(), side_engine(), and team().
|
private |
Definition at line 261 of file connect_engine.hpp.
Referenced by place_user(), ready_for_start(), set_waiting_to_choose_status(), and waiting_to_choose_faction().