The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 config &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 (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 &cfg, config &parsed_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,
description
description_map
 

Static Private Attributes

static description_map ai_configurations_ = configuration::description_map()
 
static description_map era_ai_configurations_ = configuration::description_map()
 
static description_map mod_ai_configurations_ = configuration::description_map()
 
static config default_config_ = config()
 

Detailed Description

Definition at line 59 of file configuration.hpp.

Member Typedef Documentation

Definition at line 119 of file configuration.hpp.

Member Function Documentation

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

Definition at line 104 of file configuration.cpp.

References era_ai_configurations_.

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

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

Definition at line 110 of file configuration.cpp.

References mod_ai_configurations_.

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

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

Expand simplified aspects, similar to the change from 1.7.2 to 1.7.3 but with some additional syntax options.

Definition at line 252 of file configuration.cpp.

References config::add_child(), config::all_children_range(), config::child_range(), config::clear_children(), get_ai_config_for(), config::has_attribute(), config::has_child(), config::remove_attribute(), preferences::turns(), and lg::wml_error().

Referenced by ai::holder::modify_side_ai_config(), and parse_side_config().

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

Return the config for a specified ai.

Definition at line 135 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().

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

Returns a list of available AIs.

Returns
the list of available AIs.

Definition at line 118 of file configuration.cpp.

References ai_configurations_, DBG_AI_CONFIGURATION, era_ai_configurations_, and mod_ai_configurations_.

Referenced by mp::connect::connect().

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

get default AI parameters

Returns
default AI parameters

Definition at line 173 of file configuration.cpp.

References default_config_.

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

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

void ai::configuration::init ( const config game_config)
static
bool ai::configuration::parse_side_config ( side_number  side,
const config cfg,
config parsed_cfg 
)
static

Member Data Documentation

configuration::description_map ai::configuration::ai_configurations_ = configuration::description_map()
staticprivate

Definition at line 120 of file configuration.hpp.

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

config ai::configuration::default_config_ = config()
staticprivate
configuration::description_map ai::configuration::era_ai_configurations_ = configuration::description_map()
staticprivate
configuration::description_map ai::configuration::mod_ai_configurations_ = configuration::description_map()
staticprivate

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