The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ng::configure_engine Class Reference

configure_engine More...

#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
 
int mp_countdown_init_time () const
 
int mp_countdown_reservoir_time () const
 
int mp_countdown_turn_bonus () const
 
int 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 registered_users_only () const
 
bool shuffle_sides () const
 
mp_game_settings::RANDOM_FACTION_MODE random_faction_mode () const
 
const configoptions () const
 
void set_game_name (std::string name)
 
void set_game_password (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 (int val)
 
void set_mp_countdown_reservoir_time (int val)
 
void set_mp_countdown_turn_bonus (int val)
 
void set_mp_countdown_action_bonus (int 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_registered_users_only (bool val)
 
void set_oos_debug (bool val)
 
void set_shuffle_sides (bool val)
 
void set_random_faction_mode (mp_game_settings::RANDOM_FACTION_MODE 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
 
int mp_countdown_init_time_default () const
 
int mp_countdown_reservoir_time_default () const
 
int mp_countdown_turn_bonus_default () const
 
int 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 registered_users_only_default () const
 
bool shuffle_sides_default () const
 
mp_game_settings::RANDOM_FACTION_MODE random_faction_mode_default () const
 
const configoptions_default () const
 
const mp_game_settingsget_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 configside_cfg () const
 Village gold, village support, fog, and shroud are per player but always show the player 1's values. More...
 
const configinitial_cfg () const
 

Private Attributes

saved_gamestate_
 
mp_game_settingsparameters_
 
const configinitial_
 Never nullptr. More...
 

Detailed Description

configure_engine

this class wraps the parameters relevent to mp_configure, as well as providing defaults for these parameters.

Definition at line 30 of file configure_engine.hpp.

Constructor & Destructor Documentation

ng::configure_engine::configure_engine ( saved_game state,
const config initial = nullptr 
)

Definition at line 29 of file configure_engine.cpp.

References set_use_map_settings(), and use_map_settings_default().

Member Function Documentation

bool ng::configure_engine::allow_observers ( ) const
inline

Definition at line 115 of file configure_engine.hpp.

References mp_game_settings::allow_observers, and parameters_.

bool ng::configure_engine::allow_observers_default ( ) const

Definition at line 142 of file configure_engine.cpp.

References preferences::allow_observers().

bool ng::configure_engine::fog_game ( ) const
inline

Definition at line 105 of file configure_engine.hpp.

References mp_game_settings::fog_game, and parameters_.

bool ng::configure_engine::fog_game_default ( ) const
bool ng::configure_engine::force_lock_settings ( ) const

Checks force_lock_settings in config.

Definition at line 55 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().

std::string ng::configure_engine::game_name ( ) const
inline

Definition at line 45 of file configure_engine.hpp.

References mp_game_settings::name, and parameters_.

std::string ng::configure_engine::game_name_default ( )
static
const mp_game_settings& ng::configure_engine::get_parameters ( ) const
inline

Definition at line 273 of file configure_engine.hpp.

References parameters_.

const config& ng::configure_engine::initial_cfg ( ) const
inlineprivate
bool ng::configure_engine::mp_countdown ( ) const
inline

Definition at line 90 of file configure_engine.hpp.

References mp_game_settings::mp_countdown, and parameters_.

int ng::configure_engine::mp_countdown_action_bonus ( ) const
inline
int ng::configure_engine::mp_countdown_action_bonus_default ( ) const

Definition at line 108 of file configure_engine.cpp.

References preferences::countdown_action_bonus().

Referenced by set_default_values().

bool ng::configure_engine::mp_countdown_default ( ) const

Definition at line 113 of file configure_engine.cpp.

References preferences::countdown().

Referenced by set_default_values().

int ng::configure_engine::mp_countdown_init_time ( ) const
inline

Definition at line 70 of file configure_engine.hpp.

References mp_game_settings::mp_countdown_init_time, and parameters_.

int ng::configure_engine::mp_countdown_init_time_default ( ) const

Definition at line 93 of file configure_engine.cpp.

References preferences::countdown_init_time().

Referenced by set_default_values().

int ng::configure_engine::mp_countdown_reservoir_time ( ) const
inline
int ng::configure_engine::mp_countdown_reservoir_time_default ( ) const

Definition at line 98 of file configure_engine.cpp.

References preferences::countdown_reservoir_time().

Referenced by set_default_values().

int ng::configure_engine::mp_countdown_turn_bonus ( ) const
inline

Definition at line 80 of file configure_engine.hpp.

References mp_game_settings::mp_countdown_turn_bonus, and parameters_.

int ng::configure_engine::mp_countdown_turn_bonus_default ( ) const

Definition at line 103 of file configure_engine.cpp.

References preferences::countdown_turn_bonus().

int ng::configure_engine::num_turns ( ) const
inline

Definition at line 50 of file configure_engine.hpp.

References mp_game_settings::num_turns, and parameters_.

int ng::configure_engine::num_turns_default ( ) const
const config& ng::configure_engine::options ( ) const
inline

Definition at line 135 of file configure_engine.hpp.

References mp_game_settings::options, and parameters_.

const config & ng::configure_engine::options_default ( ) const

Definition at line 163 of file configure_engine.cpp.

References preferences::options().

mp_game_settings::RANDOM_FACTION_MODE ng::configure_engine::random_faction_mode ( ) const
inline

Definition at line 130 of file configure_engine.hpp.

References parameters_.

mp_game_settings::RANDOM_FACTION_MODE ng::configure_engine::random_faction_mode_default ( ) const

Definition at line 157 of file configure_engine.cpp.

References preferences::random_faction_mode().

Referenced by set_default_values().

bool ng::configure_engine::random_start_time ( ) const
inline

Definition at line 100 of file configure_engine.hpp.

References parameters_, and mp_game_settings::random_start_time.

bool ng::configure_engine::random_start_time_default ( ) const
bool ng::configure_engine::registered_users_only ( ) const
inline

Definition at line 120 of file configure_engine.hpp.

References parameters_, and mp_game_settings::registered_users_only.

bool ng::configure_engine::registered_users_only_default ( ) const

Definition at line 147 of file configure_engine.cpp.

References preferences::registered_users_only().

void ng::configure_engine::set_allow_observers ( bool  val)
inline

Definition at line 219 of file configure_engine.hpp.

References mp_game_settings::allow_observers, and parameters_.

void ng::configure_engine::set_default_values ( )
void ng::configure_engine::set_fog_game ( bool  val)
inline

Definition at line 209 of file configure_engine.hpp.

References mp_game_settings::fog_game, and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_game_name ( std::string  name)
inline

Definition at line 144 of file configure_engine.hpp.

References mp_game_settings::name, name(), and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_game_password ( std::string  name)
inline

Definition at line 149 of file configure_engine.hpp.

References name(), parameters_, and mp_game_settings::password.

void ng::configure_engine::set_mp_countdown ( bool  val)
inline

Definition at line 194 of file configure_engine.hpp.

References mp_game_settings::mp_countdown, and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_mp_countdown_action_bonus ( int  val)
inline

Definition at line 189 of file configure_engine.hpp.

References mp_game_settings::mp_countdown_action_bonus, and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_mp_countdown_init_time ( int  val)
inline

Definition at line 174 of file configure_engine.hpp.

References mp_game_settings::mp_countdown_init_time, and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_mp_countdown_reservoir_time ( int  val)
inline

Definition at line 179 of file configure_engine.hpp.

References mp_game_settings::mp_countdown_reservoir_time, and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_mp_countdown_turn_bonus ( int  val)
inline

Definition at line 184 of file configure_engine.hpp.

References mp_game_settings::mp_countdown_turn_bonus, and parameters_.

void ng::configure_engine::set_num_turns ( int  val)
inline

Definition at line 154 of file configure_engine.hpp.

References mp_game_settings::num_turns, and parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_oos_debug ( bool  val)
inline
void ng::configure_engine::set_options ( const config cfg)
inline
void ng::configure_engine::set_random_faction_mode ( mp_game_settings::RANDOM_FACTION_MODE  val)
inline

Definition at line 239 of file configure_engine.hpp.

References parameters_.

Referenced by set_default_values().

void ng::configure_engine::set_random_start_time ( bool  val)
inline

Definition at line 204 of file configure_engine.hpp.

References parameters_, and mp_game_settings::random_start_time.

Referenced by set_default_values().

void ng::configure_engine::set_registered_users_only ( bool  val)
inline

Definition at line 224 of file configure_engine.hpp.

References parameters_, and mp_game_settings::registered_users_only.

void ng::configure_engine::set_shroud_game ( bool  val)
inline

Definition at line 214 of file configure_engine.hpp.

References parameters_, and mp_game_settings::shroud_game.

Referenced by set_default_values().

void ng::configure_engine::set_shuffle_sides ( bool  val)
inline

Definition at line 234 of file configure_engine.hpp.

References parameters_, and mp_game_settings::shuffle_sides.

void ng::configure_engine::set_use_map_settings ( bool  val)
inline

Definition at line 199 of file configure_engine.hpp.

References parameters_, and mp_game_settings::use_map_settings.

Referenced by configure_engine(), and set_default_values().

void ng::configure_engine::set_village_gold ( int  val)
inline

Definition at line 159 of file configure_engine.hpp.

References parameters_, and mp_game_settings::village_gold.

Referenced by set_default_values().

void ng::configure_engine::set_village_support ( int  val)
inline

Definition at line 164 of file configure_engine.hpp.

References parameters_, and mp_game_settings::village_support.

Referenced by set_default_values().

void ng::configure_engine::set_xp_modifier ( int  val)
inline

Definition at line 169 of file configure_engine.hpp.

References parameters_, and mp_game_settings::xp_modifier.

Referenced by set_default_values().

bool ng::configure_engine::shroud_game ( ) const
inline

Definition at line 110 of file configure_engine.hpp.

References parameters_, and mp_game_settings::shroud_game.

bool ng::configure_engine::shroud_game_default ( ) const

Definition at line 137 of file configure_engine.cpp.

References initial_cfg(), preferences::shroud(), and use_map_settings().

Referenced by set_default_values().

bool ng::configure_engine::shuffle_sides ( ) const
inline

Definition at line 125 of file configure_engine.hpp.

References parameters_, and mp_game_settings::shuffle_sides.

bool ng::configure_engine::shuffle_sides_default ( ) const

Definition at line 152 of file configure_engine.cpp.

References preferences::shuffle_sides().

const config& ng::configure_engine::side_cfg ( ) const
inlineprivate

Village gold, village support, fog, and shroud are per player but always show the player 1's values.

Todo:
This might not be 100% correct, but at the moment it is not possible to show fog and shroud per player. This might change in the future.
Todo:
: Is the above even still true? – vultraz, 2017-10-05

NOTE when 'load game' is selected there are no sides.

Definition at line 305 of file configure_engine.hpp.

References config::child_or_empty().

void ng::configure_engine::update_initial_cfg ( const config cfg)
inline

Definition at line 280 of file configure_engine.hpp.

References initial_.

Referenced by sp::enter_configure_mode().

bool ng::configure_engine::use_map_settings ( ) const
inline
bool ng::configure_engine::use_map_settings_default ( ) const
int ng::configure_engine::village_gold ( ) const
inline

Definition at line 55 of file configure_engine.hpp.

References parameters_, and mp_game_settings::village_gold.

int ng::configure_engine::village_gold_default ( ) const
int ng::configure_engine::village_support ( ) const
inline

Definition at line 60 of file configure_engine.hpp.

References parameters_, and mp_game_settings::village_support.

int ng::configure_engine::village_support_default ( ) const
void ng::configure_engine::write_parameters ( )
int ng::configure_engine::xp_modifier ( ) const
inline

Definition at line 65 of file configure_engine.hpp.

References parameters_, and mp_game_settings::xp_modifier.

int ng::configure_engine::xp_modifier_default ( ) const

Member Data Documentation

const config* ng::configure_engine::initial_
private

Never nullptr.

Definition at line 291 of file configure_engine.hpp.

Referenced by initial_cfg(), and update_initial_cfg().

mp_game_settings& ng::configure_engine::parameters_
private
saved_game& ng::configure_engine::state_
private

The documentation for this class was generated from the following files: