The Battle for Wesnoth  1.19.0-dev
Classes | Public Member Functions | Public Attributes | List of all members
mp_game_settings Struct Reference

#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
 
int mp_countdown_init_time
 
int mp_countdown_reservoir_time
 
int mp_countdown_turn_bonus
 
int 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_infoaddons
 the key is the addon_id More...
 

Detailed Description

Definition at line 26 of file mp_game_settings.hpp.

Constructor & Destructor Documentation

◆ mp_game_settings() [1/2]

mp_game_settings::mp_game_settings ( )

Definition at line 32 of file mp_game_settings.cpp.

◆ mp_game_settings() [2/2]

mp_game_settings::mp_game_settings ( const config cfg)

Definition at line 63 of file mp_game_settings.cpp.

References a, addons, and config::child_range().

Member Function Documentation

◆ to_config()

config mp_game_settings::to_config ( ) const

◆ update_addon_requirements()

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_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().

Member Data Documentation

◆ addons

std::map<std::string, addon_version_info> mp_game_settings::addons

the key is the addon_id

Definition at line 87 of file mp_game_settings.hpp.

Referenced by mp_game_settings(), campaign_controller::play_game(), to_config(), and update_addon_requirements().

◆ allow_observers

bool mp_game_settings::allow_observers

◆ fog_game

bool mp_game_settings::fog_game

◆ hash

std::string mp_game_settings::hash

◆ mode

random_faction_mode::type mp_game_settings::mode

◆ mp_campaign

std::string mp_game_settings::mp_campaign

Definition at line 41 of file mp_game_settings.hpp.

Referenced by to_config().

◆ mp_countdown

bool mp_game_settings::mp_countdown

◆ mp_countdown_action_bonus

int mp_game_settings::mp_countdown_action_bonus

◆ mp_countdown_init_time

int mp_game_settings::mp_countdown_init_time

◆ mp_countdown_reservoir_time

int mp_game_settings::mp_countdown_reservoir_time

◆ mp_countdown_turn_bonus

int mp_game_settings::mp_countdown_turn_bonus

◆ mp_era_name

std::string mp_game_settings::mp_era_name

Definition at line 38 of file mp_game_settings.hpp.

Referenced by ng::create_engine::get_parameters(), and to_config().

◆ mp_scenario

std::string mp_game_settings::mp_scenario

Definition at line 39 of file mp_game_settings.hpp.

Referenced by to_config().

◆ mp_scenario_name

std::string mp_game_settings::mp_scenario_name

Definition at line 40 of file mp_game_settings.hpp.

Referenced by to_config().

◆ name

std::string mp_game_settings::name

◆ num_turns

int mp_game_settings::num_turns

◆ options

config mp_game_settings::options

◆ password

std::string mp_game_settings::password

Definition at line 36 of file mp_game_settings.hpp.

Referenced by ng::configure_engine::set_game_password().

◆ private_replay

bool mp_game_settings::private_replay

Definition at line 58 of file mp_game_settings.hpp.

Referenced by ng::configure_engine::set_private_replay(), and to_config().

◆ random_start_time

bool mp_game_settings::random_start_time

◆ saved_game

saved_game_mode::type mp_game_settings::saved_game

◆ shroud_game

bool mp_game_settings::shroud_game

◆ shuffle_sides

bool mp_game_settings::shuffle_sides

◆ side_users

std::map<std::string, std::string> mp_game_settings::side_users

Definition at line 42 of file mp_game_settings.hpp.

Referenced by to_config().

◆ use_map_settings

bool mp_game_settings::use_map_settings

◆ village_gold

int mp_game_settings::village_gold

◆ village_support

int mp_game_settings::village_support

◆ xp_modifier

int mp_game_settings::xp_modifier

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