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

#include <mp_game_settings.hpp>

Classes

struct  addon_version_info
 

Public Member Functions

 mp_game_settings ()
 
 mp_game_settings (const config &cfg)
 
config to_config () const
 
 MAKE_ENUM (SAVED_GAME_MODE,(NONE, "no")(MIDGAME, "midgame")(SCENARIO_START, "scenaro_start")) SAVED_GAME_MODE saved_game
 
 MAKE_ENUM (RANDOM_FACTION_MODE,(DEFAULT, N_("Independent"))(NO_MIRROR, N_("No Mirror"))(NO_ALLY_MIRROR, N_("No Ally Mirror"))) RANDOM_FACTION_MODE random_faction_mode
 
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
 
std::string mp_era_name
 
std::string mp_scenario
 
std::string mp_scenario_name
 
std::string mp_campaign
 
std::vector< std::string > active_mods
 
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 registered_users_only
 
bool private_replay
 
bool shuffle_sides
 
config options
 
std::map< std::string, addon_version_infoaddons
 

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 31 of file mp_game_settings.cpp.

◆ mp_game_settings() [2/2]

mp_game_settings::mp_game_settings ( const config cfg)

Definition at line 64 of file mp_game_settings.cpp.

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

Member Function Documentation

◆ MAKE_ENUM() [1/2]

mp_game_settings::MAKE_ENUM ( SAVED_GAME_MODE  ,
(NONE, "no")(MIDGAME, "midgame")(SCENARIO_START, "scenaro_start")   
)

◆ MAKE_ENUM() [2/2]

mp_game_settings::MAKE_ENUM ( RANDOM_FACTION_MODE  ,
(DEFAULT, N_("Independent"))(NO_MIRROR, N_("No Mirror"))(NO_ALLY_MIRROR, N_("No Ally Mirror"))   
)

◆ 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 170 of file mp_game_settings.cpp.

References addons, config::debug(), mp_game_settings::addon_version_info::min_version, mp_game_settings::addon_version_info::version, and WRN_NG.

Referenced by saved_game::check_require_scenario(), and saved_game::load_mod().

Member Data Documentation

◆ active_mods

std::vector<std::string> mp_game_settings::active_mods

◆ addons

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

Definition at line 97 of file mp_game_settings.hpp.

Referenced by mp_game_settings(), 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

◆ mp_campaign

std::string mp_game_settings::mp_campaign

Definition at line 42 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

std::string mp_game_settings::mp_era

◆ mp_era_name

std::string mp_game_settings::mp_era_name

Definition at line 39 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 40 of file mp_game_settings.hpp.

Referenced by to_config().

◆ mp_scenario_name

std::string mp_game_settings::mp_scenario_name

Definition at line 41 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

◆ private_replay

bool mp_game_settings::private_replay

Definition at line 61 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

◆ registered_users_only

bool mp_game_settings::registered_users_only

◆ 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 44 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: