#include <mp_game_settings.hpp>
Classes | |
struct | addon_content |
struct | addon_version_info |
Public Member Functions | |
mp_game_settings () | |
mp_game_settings (const config &cfg) | |
config | to_config () const |
void | update_addon_requirements (const config &addon_cfg) |
Takes a config with addon metadata (id, name, version, min_version) and adds it as a requirement for this game. More... | |
Public Attributes | |
std::string | name |
std::string | password |
std::string | hash |
std::string | mp_era_name |
std::string | mp_scenario |
std::string | mp_scenario_name |
std::string | mp_campaign |
std::map< std::string, std::string > | side_users |
int | num_turns |
int | village_gold |
int | village_support |
int | xp_modifier |
std::chrono::seconds | mp_countdown_init_time |
std::chrono::seconds | mp_countdown_reservoir_time |
std::chrono::seconds | mp_countdown_turn_bonus |
std::chrono::seconds | mp_countdown_action_bonus |
bool | mp_countdown |
bool | use_map_settings |
bool | random_start_time |
bool | fog_game |
bool | shroud_game |
bool | allow_observers |
bool | private_replay |
bool | shuffle_sides |
saved_game_mode::type | saved_game |
random_faction_mode::type | mode |
config | options |
std::map< std::string, addon_version_info > | addons |
the key is the addon_id More... | |
Definition at line 28 of file mp_game_settings.hpp.
mp_game_settings::mp_game_settings | ( | ) |
Definition at line 32 of file mp_game_settings.cpp.
mp_game_settings::mp_game_settings | ( | const config & | cfg | ) |
Definition at line 63 of file mp_game_settings.cpp.
References addons, and config::child_range().
config mp_game_settings::to_config | ( | ) | const |
Definition at line 100 of file mp_game_settings.cpp.
References config::add_child(), addons, allow_observers, c, fog_game, string_enums::enum_base< Definition >::get_string(), hash, utils::join_map(), mode, mp_campaign, mp_countdown, mp_countdown_action_bonus, mp_countdown_init_time, mp_countdown_reservoir_time, mp_countdown_turn_bonus, mp_era_name, mp_scenario, mp_scenario_name, name, num_turns, options, p, private_replay, random_start_time, shroud_game, shuffle_sides, side_users, use_map_settings, village_gold, village_support, and xp_modifier.
Referenced by saved_game::to_config(), and saved_game::write_general_info().
void mp_game_settings::update_addon_requirements | ( | const config & | addon_cfg | ) |
Takes a config with addon metadata (id, name, version, min_version) and adds it as a requirement for this game.
It also updates min_version if there was already an entry for this addon_id.
Definition at line 176 of file mp_game_settings.cpp.
References addons, mp_game_settings::addon_version_info::content, config::debug(), ERR_NG, mp_game_settings::addon_content::id, mp_game_settings::addon_version_info::min_version, mp_game_settings::addon_version_info::required, mp_game_settings::addon_version_info::version, and WRN_NG.
Referenced by saved_game::check_require_scenario(), and saved_game::load_non_scenario().
std::map<std::string, addon_version_info> mp_game_settings::addons |
the key is the addon_id
Definition at line 89 of file mp_game_settings.hpp.
Referenced by mp_game_settings(), campaign_controller::play_game(), to_config(), and update_addon_requirements().
bool mp_game_settings::allow_observers |
Definition at line 59 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::allow_observers(), ng::configure_engine::set_allow_observers(), and to_config().
bool mp_game_settings::fog_game |
Definition at line 57 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::fog_game(), ng::configure_engine::set_fog_game(), to_config(), and ng::configure_engine::write_parameters().
std::string mp_game_settings::hash |
Definition at line 39 of file mp_game_settings.hpp.
Referenced by saved_game::expand_scenario(), gui2::dialogs::mp_create_game::post_show(), ng::create_engine::prepare_for_other(), and to_config().
random_faction_mode::type mp_game_settings::mode |
Definition at line 65 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::mode(), ng::configure_engine::set_random_faction_mode(), and to_config().
std::string mp_game_settings::mp_campaign |
Definition at line 43 of file mp_game_settings.hpp.
Referenced by to_config().
bool mp_game_settings::mp_countdown |
Definition at line 54 of file mp_game_settings.hpp.
Referenced by playmp_controller::after_human_turn(), play_controller::init(), ng::configure_engine::mp_countdown(), playmp_controller::play_human_turn(), ng::configure_engine::set_mp_countdown(), play_controller::start_game(), and to_config().
std::chrono::seconds mp_game_settings::mp_countdown_action_bonus |
Definition at line 53 of file mp_game_settings.hpp.
Referenced by playmp_controller::after_human_turn(), ng::configure_engine::mp_countdown_action_bonus(), ng::configure_engine::set_mp_countdown_action_bonus(), and to_config().
std::chrono::seconds mp_game_settings::mp_countdown_init_time |
Definition at line 50 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::mp_countdown_init_time(), ng::configure_engine::set_mp_countdown_init_time(), play_controller::start_game(), and to_config().
std::chrono::seconds mp_game_settings::mp_countdown_reservoir_time |
Definition at line 51 of file mp_game_settings.hpp.
Referenced by playmp_controller::after_human_turn(), ng::configure_engine::mp_countdown_reservoir_time(), ng::configure_engine::set_mp_countdown_reservoir_time(), and to_config().
std::chrono::seconds mp_game_settings::mp_countdown_turn_bonus |
Definition at line 52 of file mp_game_settings.hpp.
Referenced by playmp_controller::after_human_turn(), ng::configure_engine::mp_countdown_turn_bonus(), ng::configure_engine::set_mp_countdown_turn_bonus(), and to_config().
std::string mp_game_settings::mp_era_name |
Definition at line 40 of file mp_game_settings.hpp.
Referenced by ng::create_engine::get_parameters(), and to_config().
std::string mp_game_settings::mp_scenario |
Definition at line 41 of file mp_game_settings.hpp.
Referenced by to_config().
std::string mp_game_settings::mp_scenario_name |
Definition at line 42 of file mp_game_settings.hpp.
Referenced by to_config().
std::string mp_game_settings::name |
Definition at line 37 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::game_name(), gui2::dialogs::mp_staging::pre_show(), ng::configure_engine::set_game_name(), mp::start_local_game_commandline(), to_config(), and mp_game_settings::addon_version_info::write().
int mp_game_settings::num_turns |
Definition at line 46 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::num_turns(), campaign_controller::play_game(), ng::configure_engine::set_num_turns(), mp::start_local_game_commandline(), to_config(), and ng::configure_engine::write_parameters().
config mp_game_settings::options |
Definition at line 67 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::options(), ng::configure_engine::set_options(), and to_config().
std::string mp_game_settings::password |
Definition at line 38 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_game_password().
bool mp_game_settings::private_replay |
Definition at line 60 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_private_replay(), and to_config().
bool mp_game_settings::random_start_time |
Definition at line 56 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::random_start_time(), ng::configure_engine::set_random_start_time(), to_config(), and ng::configure_engine::write_parameters().
saved_game_mode::type mp_game_settings::saved_game |
Definition at line 63 of file mp_game_settings.hpp.
Referenced by gui2::dialogs::mp_staging::add_side_node(), ng::connect_engine::connect_engine(), ng::create_engine::create_engine(), mp::initial_level_config(), ng::side_engine::new_config(), campaign_controller::play_game(), ng::create_engine::prepare_for_saved_game(), ng::side_engine::reset(), and ng::side_engine::resolve_random().
bool mp_game_settings::shroud_game |
Definition at line 58 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_shroud_game(), ng::configure_engine::shroud_game(), to_config(), and ng::configure_engine::write_parameters().
bool mp_game_settings::shuffle_sides |
Definition at line 61 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_shuffle_sides(), ng::configure_engine::shuffle_sides(), and to_config().
std::map<std::string, std::string> mp_game_settings::side_users |
Definition at line 44 of file mp_game_settings.hpp.
Referenced by to_config().
bool mp_game_settings::use_map_settings |
Definition at line 55 of file mp_game_settings.hpp.
Referenced by gui2::dialogs::mp_staging::add_side_node(), ng::connect_engine::connect_engine(), ng::side_engine::new_config(), campaign_controller::play_game(), ng::configure_engine::set_use_map_settings(), mp::start_local_game_commandline(), to_config(), ng::configure_engine::use_map_settings(), and ng::configure_engine::write_parameters().
int mp_game_settings::village_gold |
Definition at line 47 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_village_gold(), mp::start_local_game_commandline(), to_config(), ng::configure_engine::village_gold(), and ng::configure_engine::write_parameters().
int mp_game_settings::village_support |
Definition at line 48 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_village_support(), mp::start_local_game_commandline(), to_config(), ng::configure_engine::village_support(), and ng::configure_engine::write_parameters().
int mp_game_settings::xp_modifier |
Definition at line 49 of file mp_game_settings.hpp.
Referenced by ng::configure_engine::set_xp_modifier(), mp::start_local_game_commandline(), to_config(), ng::configure_engine::write_parameters(), and ng::configure_engine::xp_modifier().