#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 config & | get_default_ai_parameters () |
get default AI parameters More... | |
static const config & | get_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, description > | description_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_ {} |
Definition at line 62 of file configuration.hpp.
|
private |
Definition at line 123 of file configuration.hpp.
|
static |
Definition at line 114 of file configuration.cpp.
References era_ai_configurations_.
Referenced by ng::connect_engine::connect_engine().
|
static |
Definition at line 120 of file configuration.cpp.
References mod_ai_configurations_.
Referenced by ng::connect_engine::connect_engine().
|
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 275 of file configuration.cpp.
References config::add_child(), ai::component::add_child(), config::all_children_view(), config::child_range(), config::clear_children(), default_ai_algorithm_, deprecated_message(), ERR_WML, FOR_REMOVAL, get_ai_config_for(), config::has_attribute(), config::has_child(), INDEFINITE, ai::just_copy_tags, lg::log_to_chat(), ai::non_aspect_attributes, ai::old_goal_tags, p, and config::remove_attribute().
Referenced by intf_append_ai(), and parse_side_config().
|
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().
|
static |
Returns a 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_.
|
static |
get 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().
|
static |
get side config from file
file | the file name to open. follows usual WML convention. | |
[out] | cfg | the config to be written from file. |
true | success |
false | failure |
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().
|
static |
Init the parameters of ai configuration parser.
game_config | game config |
Definition at line 45 of file configuration.cpp.
References ai_configurations_, ai::description::cfg, config::child_range(), config::clear(), default_ai_algorithm_, default_config_, era_ai_configurations_, ERR_AI_CONFIGURATION, ai::description::id, id, LOG_AI_CONFIGURATION, mod_ai_configurations_, ai::description::mp_rank, config::optional_child(), and ai::description::text.
Referenced by game_config_manager::init_game_config().
|
static |
[in] | side | the side to be parsed |
[in] | original_cfg | the config to be read |
[out] | cfg | parsed config |
true | success |
false | failure |
Definition at line 202 of file configuration.cpp.
References config::add_child(), config::add_child_at(), config::append(), config::child_count(), config::child_range(), config::clear(), DBG_AI_CONFIGURATION, default_config_, config::empty(), ERR_AI_CONFIGURATION, expand_simplified_aspects(), config::get(), config::has_child(), LOG_AI_CONFIGURATION, config::mandatory_child(), config::merge_children_by_attribute(), config::remove_child(), and WRN_AI_CONFIGURATION.
Referenced by ai::manager::add_ai_for_side_from_config(), and ai::ai_composite::preparse_cfg().
|
inlinestaticprivate |
Definition at line 124 of file configuration.hpp.
Referenced by get_ai_config_for(), get_available_ais(), and init().
|
inlinestaticprivate |
Definition at line 128 of file configuration.hpp.
Referenced by expand_simplified_aspects(), and init().
|
inlinestaticprivate |
Definition at line 127 of file configuration.hpp.
Referenced by get_ai_config_for(), get_default_ai_parameters(), init(), and parse_side_config().
|
inlinestaticprivate |
Definition at line 125 of file configuration.hpp.
Referenced by add_era_ai_from_config(), get_ai_config_for(), get_available_ais(), and init().
|
inlinestaticprivate |
Definition at line 126 of file configuration.hpp.
Referenced by add_mod_ai_from_config(), get_ai_config_for(), get_available_ais(), and init().