The Battle for Wesnoth  1.19.7+dev
Static Public Member Functions | Private Types | Static Private Attributes | List of all members
ai::configuration Class Reference

#include <configuration.hpp>

Static Public Member Functions

static void init (const game_config_view &game_config)
 Init the parameters of ai configuration parser. More...
 
static void add_era_ai_from_config (const config &game_config)
 
static void add_mod_ai_from_config (const config::const_child_itors &configs)
 
static const configget_default_ai_parameters ()
 get default AI parameters More...
 
static const configget_ai_config_for (const std::string &id)
 Return the config for a specified ai. More...
 
static std::vector< description * > get_available_ais ()
 Returns a list of available AIs. More...
 
static bool get_side_config_from_file (const std::string &file, config &cfg)
 get side config from file More...
 
static bool parse_side_config (side_number side, const config &original_cfg, config &cfg)
 
static void expand_simplified_aspects (side_number side, config &cfg)
 Expand simplified aspects, similar to the change from 1.7.2 to 1.7.3 but with some additional syntax options. More...
 

Private Types

typedef std::map< std::string, descriptiondescription_map
 

Static Private Attributes

static description_map ai_configurations_ {}
 
static description_map era_ai_configurations_ {}
 
static description_map mod_ai_configurations_ {}
 
static config default_config_ {}
 
static std::string default_ai_algorithm_ {}
 

Detailed Description

Definition at line 62 of file configuration.hpp.

Member Typedef Documentation

◆ description_map

typedef std::map<std::string, description> ai::configuration::description_map
private

Definition at line 123 of file configuration.hpp.

Member Function Documentation

◆ add_era_ai_from_config()

void ai::configuration::add_era_ai_from_config ( const config game_config)
static

Definition at line 114 of file configuration.cpp.

References era_ai_configurations_.

Referenced by ng::connect_engine::connect_engine().

◆ add_mod_ai_from_config()

void ai::configuration::add_mod_ai_from_config ( const config::const_child_itors configs)
static

Definition at line 120 of file configuration.cpp.

References mod_ai_configurations_.

Referenced by ng::connect_engine::connect_engine().

◆ expand_simplified_aspects()

void ai::configuration::expand_simplified_aspects ( side_number  side,
config cfg 
)
static

◆ get_ai_config_for()

const config & ai::configuration::get_ai_config_for ( const std::string &  id)
static

Return the config for a specified ai.

Definition at line 164 of file configuration.cpp.

References ai_configurations_, default_config_, era_ai_configurations_, and mod_ai_configurations_.

Referenced by expand_simplified_aspects(), and ng::side_engine::user_description().

◆ get_available_ais()

std::vector< description * > ai::configuration::get_available_ais ( )
static

Returns a list of available AIs.

Returns
the list of available AIs.

Definition at line 128 of file configuration.cpp.

References ai_configurations_, b, d, DBG_AI_CONFIGURATION, era_ai_configurations_, and mod_ai_configurations_.

◆ get_default_ai_parameters()

const config & ai::configuration::get_default_ai_parameters ( )
static

get default AI parameters

Returns
default AI parameters

Definition at line 196 of file configuration.cpp.

References default_config_.

Referenced by ai::manager::get_active_ai_holder_for_side(), and intf_debug_ai().

◆ get_side_config_from_file()

bool ai::configuration::get_side_config_from_file ( const std::string &  file,
config cfg 
)
static

get side config from file

Parameters
filethe file name to open. follows usual WML convention.
[out]cfgthe config to be written from file.
Returns
was all ok?
Return values
truesuccess
falsefailure

Definition at line 183 of file configuration.cpp.

References ERR_AI_CONFIGURATION, filesystem::get_wml_location(), LOG_AI_CONFIGURATION, preprocess_file(), and read().

Referenced by ai::manager::add_ai_for_side_from_file().

◆ init()

void ai::configuration::init ( const game_config_view game_config)
static

◆ parse_side_config()

bool ai::configuration::parse_side_config ( side_number  side,
const config original_cfg,
config cfg 
)
static

Member Data Documentation

◆ ai_configurations_

description_map ai::configuration::ai_configurations_ {}
inlinestaticprivate

Definition at line 124 of file configuration.hpp.

Referenced by get_ai_config_for(), get_available_ais(), and init().

◆ default_ai_algorithm_

std::string ai::configuration::default_ai_algorithm_ {}
inlinestaticprivate

Definition at line 128 of file configuration.hpp.

Referenced by expand_simplified_aspects(), and init().

◆ default_config_

config ai::configuration::default_config_ {}
inlinestaticprivate

◆ era_ai_configurations_

description_map ai::configuration::era_ai_configurations_ {}
inlinestaticprivate

◆ mod_ai_configurations_

description_map ai::configuration::mod_ai_configurations_ {}
inlinestaticprivate

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