#include <connect_engine.hpp>
Public Member Functions | |
side_engine (const config &cfg, connect_engine &parent_engine, const int index) | |
std::string | user_description () const |
config | new_config () const |
bool | ready_for_start () const |
bool | available_for_user (const std::string &name="") const |
void | resolve_random (randomness::mt_rng &rng, const std::vector< std::string > &avoid_faction_ids=std::vector< std::string >()) |
void | reset () |
void | place_user (const std::string &name) |
void | place_user (const config &data, bool contains_selection=false) |
void | update_controller_options () |
void | update_current_controller_index () |
bool | controller_changed (const int selection) |
void | set_controller (ng::controller controller) |
void | set_faction_commandline (const std::string &faction_name) |
void | set_controller_commandline (const std::string &controller_name) |
std::string | save_id () const |
std::string | previous_save_id () const |
const std::vector< controller_option > & | controller_options () const |
const config & | cfg () const |
ng::controller | controller () const |
unsigned | current_controller_index () const |
int | index () const |
void | set_index (int index) |
unsigned | team () const |
void | set_team (unsigned team) |
std::multimap< std::string, config > | get_side_children () |
void | set_side_children (const std::multimap< std::string, config > &children) |
int | color () const |
void | set_color (int color) |
int | gold () const |
void | set_gold (int gold) |
int | income () const |
void | set_income (int income) |
const std::string & | player_id () const |
const std::string & | reserved_for () const |
void | set_reserved_for (const std::string &reserved_for) |
const std::string & | ai_algorithm () const |
void | set_ai_algorithm (const std::string &ai_algorithm) |
bool | allow_player () const |
bool | allow_changes () const |
bool | waiting_to_choose_faction () const |
void | set_waiting_to_choose_status (bool status) |
bool | allow_shuffle () const |
flg_manager & | flg () |
const std::string | color_id () const |
const std::vector< std::string > & | color_options () const |
const std::string | team_name () const |
const std::string | user_team_name () const |
Private Member Functions | |
side_engine (const side_engine &engine)=delete | |
side_engine & | operator= (const side_engine &)=delete |
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_ |
unsigned | 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::vector< std::string > | color_options_ |
std::string | color_id_ |
Friends | |
class | connect_engine |
Definition at line 142 of file connect_engine.hpp.
ng::side_engine::side_engine | ( | const config & | cfg, |
connect_engine & | parent_engine, | ||
const int | index | ||
) |
Definition at line 821 of file connect_engine.cpp.
References config::add_child(), ai_algorithm_, allow_player_, cfg(), cfg_, saved_game::classification(), ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_NETWORK, ng::CNTR_RESERVED, color_, color_id_, color_options_, data, ng::connect_engine::default_controller_, ERR_CF, utils::find(), team::get_side_color_id_from_config(), index_, game_classification::is_scenario(), config::optional_child(), parent_, config::remove_attribute(), reserved_for_, set_controller(), ng::connect_engine::state_, team_, ng::connect_engine::team_data_, update_controller_options(), and WRN_MP.
|
privatedelete |
|
private |
Definition at line 1285 of file connect_engine.cpp.
References cfg_, controller_lock_, and controller_options_.
Referenced by update_controller_options().
|
inline |
Definition at line 210 of file connect_engine.hpp.
References ai_algorithm_.
Referenced by set_ai_algorithm().
|
inline |
Definition at line 214 of file connect_engine.hpp.
References allow_changes_.
|
inline |
Definition at line 213 of file connect_engine.hpp.
References allow_player_.
|
inline |
Definition at line 217 of file connect_engine.hpp.
References disallow_shuffle_.
bool ng::side_engine::available_for_user | ( | const std::string & | name = "" | ) | const |
Definition at line 1125 of file connect_engine.cpp.
References ng::CNTR_NETWORK, ng::CNTR_RESERVED, controller_, player_id_, and reserved_for_.
Referenced by ready_for_start().
|
inline |
|
inline |
|
inline |
Definition at line 220 of file connect_engine.hpp.
References color_id_.
|
inline |
Definition at line 221 of file connect_engine.hpp.
References color_options_.
|
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 1240 of file connect_engine.cpp.
References 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 218 of file connect_engine.hpp.
References flg_.
std::multimap< std::string, config > ng::side_engine::get_side_children | ( | ) |
Definition at line 359 of file connect_engine.cpp.
References config::child_range().
|
inline |
|
inline |
|
inline |
config ng::side_engine::new_config | ( | ) | const |
Definition at line 947 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(), config::clear_children(), ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LOCAL, ng::CNTR_RESERVED, color_id_, controller_, controller_lock_, ng::flg_manager::current_faction(), ng::flg_manager::current_gender(), ng::flg_manager::current_leader(), ng::flg_manager::default_leader_cfg(), config::empty(), flg_, prefs::get(), gold_, config::has_attribute(), income_, index_, LOG_MP, prefs::login(), 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_data_, mp_game_settings::use_map_settings, user_description(), and VGETTEXT.
|
privatedelete |
void ng::side_engine::place_user | ( | const config & | data, |
bool | contains_selection = false |
||
) |
Definition at line 1179 of file connect_engine.cpp.
References data, 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_.
void ng::side_engine::place_user | ( | const std::string & | name | ) |
Definition at line 1171 of file connect_engine.cpp.
References data.
|
inline |
Definition at line 206 of file connect_engine.hpp.
References player_id_.
|
inline |
Definition at line 186 of file connect_engine.hpp.
bool ng::side_engine::ready_for_start | ( | ) | const |
Definition at line 1095 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_, prefs::get(), player_id_, and waiting_to_choose_faction_.
|
inline |
Definition at line 207 of file connect_engine.hpp.
References reserved_for_.
Referenced by set_reserved_for().
void ng::side_engine::reset | ( | ) |
Definition at line 1160 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 | ( | randomness::mt_rng & | rng, |
const std::vector< std::string > & | avoid_faction_ids = std::vector<std::string>() |
||
) |
Definition at line 1145 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 211 of file connect_engine.hpp.
References ai_algorithm(), and ai_algorithm_.
|
inline |
Definition at line 201 of file connect_engine.hpp.
References color(), color_, color_id_, and color_options_.
void ng::side_engine::set_controller | ( | ng::controller | controller | ) |
Definition at line 1258 of file connect_engine.cpp.
References controller(), controller_, and update_current_controller_index().
Referenced by controller_changed(), place_user(), reset(), set_controller_commandline(), and side_engine().
void ng::side_engine::set_controller_commandline | ( | const std::string & | controller_name | ) |
Definition at line 1270 of file connect_engine.cpp.
References ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LOCAL, gui2::dialogs::controller_name(), player_id_, and set_controller().
void ng::side_engine::set_faction_commandline | ( | const std::string & | faction_name | ) |
Definition at line 1265 of file connect_engine.cpp.
References flg_, and ng::flg_manager::set_current_faction().
|
inline |
Definition at line 203 of file connect_engine.hpp.
|
inline |
Definition at line 205 of file connect_engine.hpp.
|
inline |
Definition at line 195 of file connect_engine.hpp.
|
inline |
Definition at line 208 of file connect_engine.hpp.
References reserved_for(), and reserved_for_.
void ng::side_engine::set_side_children | ( | const std::multimap< std::string, config > & | children | ) |
Definition at line 372 of file connect_engine.cpp.
|
inline |
Definition at line 197 of file connect_engine.hpp.
|
inline |
Definition at line 216 of file connect_engine.hpp.
References waiting_to_choose_faction_.
Referenced by controller_changed(), and reset().
|
inline |
|
inline |
Definition at line 223 of file connect_engine.hpp.
References parent_, team_, and ng::connect_engine::team_data_.
void ng::side_engine::update_controller_options | ( | ) |
Definition at line 1195 of file connect_engine.cpp.
References _(), add_controller_option(), ng::CNTR_COMPUTER, ng::CNTR_EMPTY, ng::CNTR_LOCAL, ng::CNTR_NETWORK, ng::CNTR_RESERVED, ng::connect_engine::connected_users(), controller_options_, ng::connect_engine::default_controller_, ng::connect_engine::mp_metadata_, parent_, reserved_for_, and update_current_controller_index().
Referenced by side_engine().
void ng::side_engine::update_current_controller_index | ( | ) |
Definition at line 1220 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 931 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 228 of file connect_engine.hpp.
References t_string::from_serialized(), parent_, team_, and ng::connect_engine::team_data_.
|
inline |
Definition at line 215 of file connect_engine.hpp.
References waiting_to_choose_faction_.
|
friend |
Definition at line 237 of file connect_engine.hpp.
|
private |
Definition at line 264 of file connect_engine.hpp.
Referenced by ai_algorithm(), new_config(), set_ai_algorithm(), side_engine(), and user_description().
|
private |
Definition at line 269 of file connect_engine.hpp.
Referenced by allow_changes(), new_config(), and ready_for_start().
|
private |
Definition at line 249 of file connect_engine.hpp.
Referenced by allow_player(), new_config(), ready_for_start(), side_engine(), and user_description().
|
private |
Definition at line 242 of file connect_engine.hpp.
Referenced by add_controller_option(), cfg(), new_config(), previous_save_id(), save_id(), and side_engine().
|
private |
Definition at line 266 of file connect_engine.hpp.
Referenced by new_config(), and resolve_random().
|
private |
Definition at line 254 of file connect_engine.hpp.
Referenced by color(), set_color(), and side_engine().
|
private |
Definition at line 274 of file connect_engine.hpp.
Referenced by color_id(), new_config(), set_color(), and side_engine().
|
private |
Definition at line 272 of file connect_engine.hpp.
Referenced by color_options(), set_color(), and side_engine().
|
private |
Definition at line 245 of file connect_engine.hpp.
Referenced by available_for_user(), controller(), new_config(), ready_for_start(), set_controller(), update_current_controller_index(), and user_description().
|
private |
Definition at line 250 of file connect_engine.hpp.
Referenced by add_controller_option(), and new_config().
|
private |
Definition at line 247 of file connect_engine.hpp.
Referenced by add_controller_option(), controller_changed(), controller_options(), update_controller_options(), and update_current_controller_index().
|
private |
Definition at line 246 of file connect_engine.hpp.
Referenced by current_controller_index(), and update_current_controller_index().
|
private |
Definition at line 267 of file connect_engine.hpp.
Referenced by allow_shuffle().
|
private |
Definition at line 268 of file connect_engine.hpp.
Referenced by flg(), new_config(), place_user(), reset(), resolve_random(), and set_faction_commandline().
|
private |
Definition at line 255 of file connect_engine.hpp.
Referenced by gold(), new_config(), and set_gold().
|
private |
Definition at line 256 of file connect_engine.hpp.
Referenced by income(), new_config(), and set_income().
|
private |
Definition at line 252 of file connect_engine.hpp.
Referenced by index(), new_config(), resolve_random(), set_index(), and side_engine().
|
private |
Definition at line 243 of file connect_engine.hpp.
Referenced by controller_changed(), new_config(), place_user(), reset(), resolve_random(), side_engine(), team_name(), update_controller_options(), and user_team_name().
|
private |
Definition at line 263 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(), and update_current_controller_index().
|
private |
Definition at line 262 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 253 of file connect_engine.hpp.
Referenced by new_config(), set_team(), side_engine(), team(), team_name(), and user_team_name().
|
private |
Definition at line 270 of file connect_engine.hpp.
Referenced by place_user(), ready_for_start(), set_waiting_to_choose_status(), and waiting_to_choose_faction().