#include <configure_engine.hpp>
Public Member Functions | |
configure_engine (saved_game &state, const config *initial=nullptr) | |
void | set_default_values () |
Set all parameters to their default values. More... | |
bool | force_lock_settings () const |
Checks force_lock_settings in config. More... | |
std::string | game_name () const |
int | num_turns () const |
int | village_gold () const |
int | village_support () const |
int | xp_modifier () const |
auto | mp_countdown_init_time () const |
auto | mp_countdown_reservoir_time () const |
auto | mp_countdown_turn_bonus () const |
auto | mp_countdown_action_bonus () const |
bool | mp_countdown () const |
bool | use_map_settings () const |
bool | random_start_time () const |
bool | fog_game () const |
bool | shroud_game () const |
bool | allow_observers () const |
bool | shuffle_sides () const |
random_faction_mode::type | mode () const |
const config & | options () const |
void | set_game_name (const std::string &name) |
void | set_game_password (const std::string &name) |
void | set_num_turns (int val) |
void | set_village_gold (int val) |
void | set_village_support (int val) |
void | set_xp_modifier (int val) |
void | set_mp_countdown_init_time (const std::chrono::seconds &val) |
void | set_mp_countdown_reservoir_time (const std::chrono::seconds &val) |
void | set_mp_countdown_turn_bonus (const std::chrono::seconds &val) |
void | set_mp_countdown_action_bonus (const std::chrono::seconds &val) |
void | set_mp_countdown (bool val) |
void | set_use_map_settings (bool val) |
void | set_random_start_time (bool val) |
void | set_fog_game (bool val) |
void | set_shroud_game (bool val) |
void | set_allow_observers (bool val) |
void | set_private_replay (bool val) |
void | set_oos_debug (bool val) |
void | set_shuffle_sides (bool val) |
void | set_random_faction_mode (random_faction_mode::type val) |
void | set_options (const config &cfg) |
int | num_turns_default () const |
int | village_gold_default () const |
int | village_support_default () const |
int | xp_modifier_default () const |
std::chrono::seconds | mp_countdown_init_time_default () const |
std::chrono::seconds | mp_countdown_reservoir_time_default () const |
std::chrono::seconds | mp_countdown_turn_bonus_default () const |
std::chrono::seconds | mp_countdown_action_bonus_default () const |
bool | mp_countdown_default () const |
bool | use_map_settings_default () const |
bool | random_start_time_default () const |
bool | fog_game_default () const |
bool | shroud_game_default () const |
bool | allow_observers_default () const |
bool | shuffle_sides_default () const |
random_faction_mode::type | random_faction_mode_default () const |
const config & | options_default () const |
const mp_game_settings & | get_parameters () const |
void | write_parameters () |
void | update_initial_cfg (const config &cfg) |
Static Public Member Functions | |
static std::string | game_name_default () |
Private Member Functions | |
const config & | side_cfg () const |
Village gold, village support, fog, and shroud are per player but always show the player 1's values. More... | |
const config & | initial_cfg () const |
Private Attributes | |
saved_game & | state_ |
mp_game_settings & | parameters_ |
const config * | initial_ |
Never nullptr. More... | |
this class wraps the parameters relevant to mp_configure, as well as providing defaults for these parameters.
Definition at line 31 of file configure_engine.hpp.
ng::configure_engine::configure_engine | ( | saved_game & | state, |
const config * | initial = nullptr |
||
) |
Definition at line 26 of file configure_engine.cpp.
References set_use_map_settings(), and use_map_settings_default().
|
inline |
Definition at line 116 of file configure_engine.hpp.
References mp_game_settings::allow_observers, and parameters_.
bool ng::configure_engine::allow_observers_default | ( | ) | const |
Definition at line 139 of file configure_engine.cpp.
References prefs::get().
|
inline |
Definition at line 106 of file configure_engine.hpp.
References mp_game_settings::fog_game, and parameters_.
bool ng::configure_engine::fog_game_default | ( | ) | const |
Definition at line 127 of file configure_engine.cpp.
References saved_game::classification(), prefs::get(), initial_cfg(), game_classification::is_normal_mp_game(), state_, and use_map_settings().
Referenced by set_default_values().
bool ng::configure_engine::force_lock_settings | ( | ) | const |
Checks force_lock_settings in config.
Definition at line 52 of file configure_engine.cpp.
References saved_game::classification(), initial_cfg(), game_classification::is_normal_mp_game(), and state_.
Referenced by use_map_settings_default().
|
inline |
Definition at line 46 of file configure_engine.hpp.
References mp_game_settings::name, and parameters_.
|
static |
Definition at line 57 of file configure_engine.cpp.
References prefs::get(), prefs::login(), and VGETTEXT.
Referenced by gui2::dialogs::mp_create_game::post_show(), gui2::dialogs::mp_create_game::pre_show(), and set_default_values().
|
inline |
Definition at line 265 of file configure_engine.hpp.
References parameters_.
|
inlineprivate |
Definition at line 302 of file configure_engine.hpp.
References initial_.
Referenced by fog_game_default(), force_lock_settings(), num_turns_default(), random_start_time_default(), shroud_game_default(), village_gold_default(), village_support_default(), and xp_modifier_default().
|
inline |
Definition at line 126 of file configure_engine.hpp.
References mp_game_settings::mode, and parameters_.
|
inline |
Definition at line 91 of file configure_engine.hpp.
References mp_game_settings::mp_countdown, and parameters_.
|
inline |
Definition at line 86 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_action_bonus, and parameters_.
std::chrono::seconds ng::configure_engine::mp_countdown_action_bonus_default | ( | ) | const |
Definition at line 105 of file configure_engine.cpp.
References prefs::countdown_action_bonus(), and prefs::get().
Referenced by set_default_values().
bool ng::configure_engine::mp_countdown_default | ( | ) | const |
Definition at line 110 of file configure_engine.cpp.
References prefs::get().
Referenced by set_default_values().
|
inline |
Definition at line 71 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_init_time, and parameters_.
std::chrono::seconds ng::configure_engine::mp_countdown_init_time_default | ( | ) | const |
Definition at line 90 of file configure_engine.cpp.
References prefs::countdown_init_time(), and prefs::get().
Referenced by set_default_values().
|
inline |
Definition at line 76 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_reservoir_time, and parameters_.
std::chrono::seconds ng::configure_engine::mp_countdown_reservoir_time_default | ( | ) | const |
Definition at line 95 of file configure_engine.cpp.
References prefs::countdown_reservoir_time(), and prefs::get().
Referenced by set_default_values().
|
inline |
Definition at line 81 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_turn_bonus, and parameters_.
std::chrono::seconds ng::configure_engine::mp_countdown_turn_bonus_default | ( | ) | const |
Definition at line 100 of file configure_engine.cpp.
References prefs::countdown_turn_bonus(), and prefs::get().
|
inline |
Definition at line 51 of file configure_engine.hpp.
References mp_game_settings::num_turns, and parameters_.
int ng::configure_engine::num_turns_default | ( | ) | const |
Definition at line 64 of file configure_engine.cpp.
References prefs::get(), settings::get_turns(), initial_cfg(), and use_map_settings().
Referenced by set_default_values().
|
inline |
Definition at line 131 of file configure_engine.hpp.
References mp_game_settings::options, and parameters_.
const config & ng::configure_engine::options_default | ( | ) | const |
Definition at line 160 of file configure_engine.cpp.
References prefs::get(), and prefs::options().
random_faction_mode::type ng::configure_engine::random_faction_mode_default | ( | ) | const |
Definition at line 149 of file configure_engine.cpp.
References prefs::get(), and string_enums::enum_base< Definition >::get_enum().
Referenced by set_default_values().
|
inline |
Definition at line 101 of file configure_engine.hpp.
References parameters_, and mp_game_settings::random_start_time.
bool ng::configure_engine::random_start_time_default | ( | ) | const |
Definition at line 120 of file configure_engine.cpp.
References prefs::get(), initial_cfg(), and use_map_settings().
Referenced by set_default_values().
|
inline |
Definition at line 215 of file configure_engine.hpp.
References mp_game_settings::allow_observers, and parameters_.
void ng::configure_engine::set_default_values | ( | ) |
Set all parameters to their default values.
Definition at line 34 of file configure_engine.cpp.
References fog_game_default(), game_name_default(), mp_countdown_action_bonus_default(), mp_countdown_default(), mp_countdown_init_time_default(), mp_countdown_reservoir_time_default(), num_turns_default(), random_faction_mode_default(), random_start_time_default(), set_fog_game(), set_game_name(), set_mp_countdown(), set_mp_countdown_action_bonus(), set_mp_countdown_init_time(), set_mp_countdown_reservoir_time(), set_num_turns(), set_random_faction_mode(), set_random_start_time(), set_shroud_game(), set_use_map_settings(), set_village_gold(), set_village_support(), set_xp_modifier(), shroud_game_default(), use_map_settings_default(), village_gold_default(), village_support_default(), and xp_modifier_default().
|
inline |
Definition at line 205 of file configure_engine.hpp.
References mp_game_settings::fog_game, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 140 of file configure_engine.hpp.
References mp_game_settings::name, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 145 of file configure_engine.hpp.
References parameters_, and mp_game_settings::password.
|
inline |
Definition at line 190 of file configure_engine.hpp.
References mp_game_settings::mp_countdown, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 185 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_action_bonus, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 170 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_init_time, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 175 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_reservoir_time, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 180 of file configure_engine.hpp.
References mp_game_settings::mp_countdown_turn_bonus, and parameters_.
|
inline |
Definition at line 150 of file configure_engine.hpp.
References mp_game_settings::num_turns, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 225 of file configure_engine.hpp.
References saved_game::classification(), game_classification::oos_debug, and state_.
void ng::configure_engine::set_options | ( | const config & | cfg | ) |
Definition at line 154 of file configure_engine.cpp.
References prefs::get(), mp_game_settings::options, parameters_, and prefs::set_options().
Referenced by gui2::dialogs::sp_options_configure::post_show().
|
inline |
Definition at line 220 of file configure_engine.hpp.
References parameters_, and mp_game_settings::private_replay.
|
inline |
Definition at line 235 of file configure_engine.hpp.
References mp_game_settings::mode, and parameters_.
Referenced by set_default_values().
|
inline |
Definition at line 200 of file configure_engine.hpp.
References parameters_, and mp_game_settings::random_start_time.
Referenced by set_default_values().
|
inline |
Definition at line 210 of file configure_engine.hpp.
References parameters_, and mp_game_settings::shroud_game.
Referenced by set_default_values().
|
inline |
Definition at line 230 of file configure_engine.hpp.
References parameters_, and mp_game_settings::shuffle_sides.
|
inline |
Definition at line 195 of file configure_engine.hpp.
References parameters_, and mp_game_settings::use_map_settings.
Referenced by configure_engine(), and set_default_values().
|
inline |
Definition at line 155 of file configure_engine.hpp.
References parameters_, and mp_game_settings::village_gold.
Referenced by set_default_values().
|
inline |
Definition at line 160 of file configure_engine.hpp.
References parameters_, and mp_game_settings::village_support.
Referenced by set_default_values().
|
inline |
Definition at line 165 of file configure_engine.hpp.
References parameters_, and mp_game_settings::xp_modifier.
Referenced by set_default_values().
|
inline |
Definition at line 111 of file configure_engine.hpp.
References parameters_, and mp_game_settings::shroud_game.
bool ng::configure_engine::shroud_game_default | ( | ) | const |
Definition at line 134 of file configure_engine.cpp.
References prefs::get(), initial_cfg(), and use_map_settings().
Referenced by set_default_values().
|
inline |
Definition at line 121 of file configure_engine.hpp.
References parameters_, and mp_game_settings::shuffle_sides.
bool ng::configure_engine::shuffle_sides_default | ( | ) | const |
Definition at line 144 of file configure_engine.cpp.
References prefs::get().
|
inlineprivate |
Village gold, village support, fog, and shroud are per player but always show the player 1's values.
NOTE when 'load game' is selected there are no sides.
Definition at line 297 of file configure_engine.hpp.
References config::child_or_empty(), and initial_.
|
inline |
Definition at line 272 of file configure_engine.hpp.
References initial_.
Referenced by sp::configure_campaign().
|
inline |
Definition at line 96 of file configure_engine.hpp.
References parameters_, and mp_game_settings::use_map_settings.
Referenced by fog_game_default(), num_turns_default(), random_start_time_default(), shroud_game_default(), village_gold_default(), village_support_default(), and xp_modifier_default().
bool ng::configure_engine::use_map_settings_default | ( | ) | const |
Definition at line 115 of file configure_engine.cpp.
References force_lock_settings(), and prefs::get().
Referenced by configure_engine(), and set_default_values().
|
inline |
Definition at line 56 of file configure_engine.hpp.
References parameters_, and mp_game_settings::village_gold.
int ng::configure_engine::village_gold_default | ( | ) | const |
Definition at line 69 of file configure_engine.cpp.
References saved_game::classification(), prefs::get(), settings::get_village_gold(), initial_cfg(), state_, use_map_settings(), and prefs::village_gold().
Referenced by set_default_values().
|
inline |
Definition at line 61 of file configure_engine.hpp.
References parameters_, and mp_game_settings::village_support.
int ng::configure_engine::village_support_default | ( | ) | const |
Definition at line 76 of file configure_engine.cpp.
References prefs::get(), settings::get_village_support(), initial_cfg(), use_map_settings(), and prefs::village_support().
Referenced by set_default_values().
void ng::configure_engine::write_parameters | ( | ) |
Definition at line 165 of file configure_engine.cpp.
References mp_game_settings::fog_game, saved_game::get_starting_point(), tod_manager::is_start_ToD(), saved_game::mp_settings(), mp_game_settings::num_turns, mp_game_settings::random_start_time, mp_game_settings::shroud_game, state_, mp_game_settings::use_map_settings, mp_game_settings::village_gold, mp_game_settings::village_support, and mp_game_settings::xp_modifier.
|
inline |
Definition at line 66 of file configure_engine.hpp.
References parameters_, and mp_game_settings::xp_modifier.
int ng::configure_engine::xp_modifier_default | ( | ) | const |
Definition at line 83 of file configure_engine.cpp.
References prefs::get(), settings::get_xp_modifier(), initial_cfg(), use_map_settings(), and prefs::xp_modifier().
Referenced by set_default_values().
|
private |
Never nullptr.
Definition at line 283 of file configure_engine.hpp.
Referenced by initial_cfg(), side_cfg(), and update_initial_cfg().
|
private |
Definition at line 280 of file configure_engine.hpp.
Referenced by allow_observers(), fog_game(), game_name(), get_parameters(), mode(), mp_countdown(), mp_countdown_action_bonus(), mp_countdown_init_time(), mp_countdown_reservoir_time(), mp_countdown_turn_bonus(), num_turns(), options(), random_start_time(), set_allow_observers(), set_fog_game(), set_game_name(), set_game_password(), set_mp_countdown(), set_mp_countdown_action_bonus(), set_mp_countdown_init_time(), set_mp_countdown_reservoir_time(), set_mp_countdown_turn_bonus(), set_num_turns(), set_options(), set_private_replay(), set_random_faction_mode(), set_random_start_time(), set_shroud_game(), set_shuffle_sides(), set_use_map_settings(), set_village_gold(), set_village_support(), set_xp_modifier(), shroud_game(), shuffle_sides(), use_map_settings(), village_gold(), village_support(), and xp_modifier().
|
private |
Definition at line 278 of file configure_engine.hpp.
Referenced by fog_game_default(), force_lock_settings(), set_oos_debug(), village_gold_default(), and write_parameters().