Contains the general settings which have a default. More...
Functions | |
int | get_turns (const std::string &value) |
Gets the number of turns. More... | |
int | get_village_gold (const std::string &value, const game_classification *classification=nullptr) |
Gets the village gold. More... | |
int | get_village_support (const std::string &value) |
Gets the village unit level support. More... | |
int | get_xp_modifier (const std::string &value) |
Gets the xp modifier. More... | |
Variables | |
const int | turns_min = 1 |
minimum number of turns More... | |
const int | turns_max = 100 |
maximum number of turns More... | |
const int | turns_default = 100 |
default number of turns More... | |
const int | turns_step = 1 |
slider step size for turns More... | |
Contains the general settings which have a default.
These values can be used to initialize the preferences, but also to set map values if these aren't defined.
int settings::get_turns | ( | const std::string & | value | ) |
Gets the number of turns.
If no valid value supplied, it will return a default. The value is also range checked. When out of bounds, it will be set to the nearest bound.
value | string containing the number of turns |
Definition at line 28 of file map_settings.cpp.
References turns_default, turns_max, and turns_min.
Referenced by ng::configure_engine::num_turns_default(), and mp::start_local_game_commandline().
int settings::get_village_gold | ( | const std::string & | value, |
const game_classification * | classification = nullptr |
||
) |
Gets the village gold.
If no valid value supplied, it will return a default. The default is 1 for singleplayer, and 2 for multiplayer.
value | string containing the village gold |
classification |
Definition at line 40 of file map_settings.cpp.
References resources::classification, and game_classification::is_normal_mp_game().
Referenced by mp::start_local_game_commandline(), prefs::village_gold(), and ng::configure_engine::village_gold_default().
int settings::get_village_support | ( | const std::string & | value | ) |
Gets the village unit level support.
If no valid value supplied, it will return a default.
value | string containing the village support |
Definition at line 45 of file map_settings.cpp.
Referenced by mp::start_local_game_commandline(), prefs::village_support(), and ng::configure_engine::village_support_default().
int settings::get_xp_modifier | ( | const std::string & | value | ) |
Gets the xp modifier.
If no valid value supplied, it will return a default.
value | string containing the xp modifier |
Definition at line 50 of file map_settings.cpp.
Referenced by mp::start_local_game_commandline(), prefs::xp_modifier(), and ng::configure_engine::xp_modifier_default().
const int settings::turns_default = 100 |
const int settings::turns_max = 100 |
maximum number of turns
Definition at line 46 of file map_settings.hpp.
Referenced by get_turns(), and gui2::dialogs::mp_create_game::post_show().
const int settings::turns_min = 1 |
const int settings::turns_step = 1 |
slider step size for turns
Definition at line 48 of file map_settings.hpp.