The Battle for Wesnoth  1.19.5+dev
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
game_config_manager Class Reference

#include <game_config_manager.hpp>

Public Types

enum  FORCE_RELOAD_CONFIG { FORCE_RELOAD , NO_FORCE_RELOAD , NO_INCLUDE_RELOAD }
 

Public Member Functions

 game_config_manager (const commandline_options &cmdline_opts)
 
 ~game_config_manager ()
 
 game_config_manager (const game_config_manager &)=delete
 
game_config_manageroperator= (const game_config_manager &)=delete
 
const game_config_viewgame_config () const
 
const preproc_mapold_defines_map () const
 
const std::shared_ptr< terrain_type_data > & terrain_types () const
 
std::vector< achievement_group > & get_achievements ()
 
bool init_game_config (FORCE_RELOAD_CONFIG force_reload)
 
void reload_changed_game_config ()
 
void load_game_config_for_editor ()
 
void load_game_config_for_game (const game_classification &classification, const std::string &scenario_id)
 
void load_game_config_for_create (bool is_mp, bool is_test=false)
 

Static Public Member Functions

static game_config_managerget ()
 

Private Member Functions

void set_enabled_addon (std::set< std::string > addon_ids)
 
void set_enabled_addon_all ()
 
void load_game_config (bool reload_everything, const game_classification *classification, const std::string &scenario_id)
 
void load_game_config_with_loadscreen (FORCE_RELOAD_CONFIG force_reload, const game_classification *classification, const std::string &scenario_id)
 
void load_addons_cfg ()
 
void set_multiplayer_hashes ()
 
void set_unit_data ()
 

Private Attributes

const commandline_optionscmdline_opts_
 
config game_config_
 
game_config_view game_config_view_
 
std::map< std::string, configaddon_cfgs_
 
std::set< std::string > active_addons_
 
preproc_map old_defines_map_
 
filesystem::binary_paths_manager paths_manager_
 
game_config::config_cachecache_
 
std::shared_ptr< terrain_type_datatdata_
 
achievements achievements_
 

Friends

class game_config_view
 

Detailed Description

Definition at line 28 of file game_config_manager.hpp.

Member Enumeration Documentation

◆ FORCE_RELOAD_CONFIG

Enumerator
FORCE_RELOAD 

Always reload config.

NO_FORCE_RELOAD 

Don't reload if the previous defines equal the new defines.

NO_INCLUDE_RELOAD 

Don't reload if the previous defines include the new defines.

Definition at line 38 of file game_config_manager.hpp.

Constructor & Destructor Documentation

◆ game_config_manager() [1/2]

game_config_manager::game_config_manager ( const commandline_options cmdline_opts)

◆ ~game_config_manager()

game_config_manager::~game_config_manager ( )

Definition at line 90 of file game_config_manager.cpp.

References singleton.

◆ game_config_manager() [2/2]

game_config_manager::game_config_manager ( const game_config_manager )
delete

Member Function Documentation

◆ game_config()

const game_config_view& game_config_manager::game_config ( ) const
inline

◆ get()

game_config_manager * game_config_manager::get ( )
static

◆ get_achievements()

std::vector<achievement_group>& game_config_manager::get_achievements ( )
inline

◆ init_game_config()

bool game_config_manager::init_game_config ( FORCE_RELOAD_CONFIG  force_reload)

◆ load_addons_cfg()

void game_config_manager::load_addons_cfg ( )
private

◆ load_game_config()

void game_config_manager::load_game_config ( bool  reload_everything,
const game_classification classification,
const std::string &  scenario_id 
)
private

◆ load_game_config_for_create()

void game_config_manager::load_game_config_for_create ( bool  is_mp,
bool  is_test = false 
)

◆ load_game_config_for_editor()

void game_config_manager::load_game_config_for_editor ( )

◆ load_game_config_for_game()

void game_config_manager::load_game_config_for_game ( const game_classification classification,
const std::string &  scenario_id 
)

◆ load_game_config_with_loadscreen()

void game_config_manager::load_game_config_with_loadscreen ( FORCE_RELOAD_CONFIG  force_reload,
const game_classification classification,
const std::string &  scenario_id 
)
private

◆ old_defines_map()

const preproc_map& game_config_manager::old_defines_map ( ) const
inline

Definition at line 49 of file game_config_manager.hpp.

References old_defines_map_.

◆ operator=()

game_config_manager& game_config_manager::operator= ( const game_config_manager )
delete

◆ reload_changed_game_config()

void game_config_manager::reload_changed_game_config ( )

◆ set_enabled_addon()

void game_config_manager::set_enabled_addon ( std::set< std::string >  addon_ids)
private

◆ set_enabled_addon_all()

void game_config_manager::set_enabled_addon_all ( )
private

◆ set_multiplayer_hashes()

void game_config_manager::set_multiplayer_hashes ( )
private

Definition at line 649 of file game_config_manager.cpp.

References config::add_child(), game_config(), game_config_, and config::hash().

Referenced by load_game_config().

◆ set_unit_data()

void game_config_manager::set_unit_data ( )
private

◆ terrain_types()

const std::shared_ptr<terrain_type_data>& game_config_manager::terrain_types ( ) const
inline

Friends And Related Function Documentation

◆ game_config_view

friend class game_config_view
friend

Definition at line 30 of file game_config_manager.hpp.

Member Data Documentation

◆ achievements_

achievements game_config_manager::achievements_
private

Definition at line 91 of file game_config_manager.hpp.

Referenced by get_achievements(), and load_game_config().

◆ active_addons_

std::set<std::string> game_config_manager::active_addons_
private

Definition at line 81 of file game_config_manager.hpp.

Referenced by load_game_config(), and set_enabled_addon_all().

◆ addon_cfgs_

std::map<std::string, config> game_config_manager::addon_cfgs_
private

◆ cache_

game_config::config_cache& game_config_manager::cache_
private

◆ cmdline_opts_

const commandline_options& game_config_manager::cmdline_opts_
private

◆ game_config_

config game_config_manager::game_config_
private

◆ game_config_view_

game_config_view game_config_manager::game_config_view_
private

Definition at line 78 of file game_config_manager.hpp.

Referenced by game_config(), set_enabled_addon(), and set_enabled_addon_all().

◆ old_defines_map_

preproc_map game_config_manager::old_defines_map_
private

◆ paths_manager_

filesystem::binary_paths_manager game_config_manager::paths_manager_
private

Definition at line 85 of file game_config_manager.hpp.

Referenced by load_game_config().

◆ tdata_

std::shared_ptr<terrain_type_data> game_config_manager::tdata_
private

Definition at line 89 of file game_config_manager.hpp.

Referenced by load_game_config(), and terrain_types().


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