19 #ifndef VALUE_TRANSLATOR_HPP_INCLUDED
20 #define VALUE_TRANSLATOR_HPP_INCLUDED
40 return lexical_cast_default<T>(cfg[
"value"]);
68 return cfg[
"value"].to_bool();
343 std::vector<variant> vars;
344 for(attacks_vector::const_iterator
i = value.begin();
i != value.end(); ++
i) {
static config cfg_to_value(const config &cfg)
static void variant_to_value(const variant &, terrain_filter &)
static variant value_to_variant(const std::string &value)
static void cfg_to_value(const config &cfg, bool &value)
static void variant_to_value(const variant &var, int &value)
static variant value_to_variant(const T &value)
static config value_to_cfg(const terrain_filter &value)
static void value_to_cfg(const bool &value, config &cfg)
static void cfg_to_value(const config &cfg, config &value)
static void variant_to_value(const variant &, T &)
static void variant_to_value(const variant &var, std::string &value)
static config value_to_cfg(const unit_advancements_aspect &value)
static void variant_to_value(const variant &var, bool &value)
static void value_to_variant(const T &, variant &)
static unit_advancements_aspect cfg_to_value(const config &cfg)
AI Support engine - creating specific ai components from config.
static variant value_to_variant(const attacks_vector &value)
const config & child_or_empty(const std::string &key) const
Returns the first child with the given key, or an empty config if there is none.
static void value_to_cfg(const unit_advancements_aspect &value, config &cfg)
To lexical_cast(From value)
Lexical cast converts one type to another.
static terrain_filter cfg_to_value(const config &cfg)
static variant value_to_variant(const terrain_filter &value)
static void value_to_cfg(const std::vector< std::string > &value, config &cfg)
static void value_to_cfg(const terrain_filter &value, config &cfg)
std::vector< attack_analysis > attacks_vector
static void cfg_to_value(const config &cfg, std::vector< std::string > &value)
A small explanation about what's going on here: Each action has access to two game_info objects First...
static void value_to_cfg(const config &value, config &cfg)
static void cfg_to_value(const config &cfg, terrain_filter &value)
static int variant_to_value(const variant &var)
static config value_to_cfg(const T &value)
filter_context * filter_con
static void cfg_to_value(const config &cfg, T &value)
GLsizei const GLfloat * value
static void value_to_variant(const attacks_vector &value, variant &var)
static void value_to_variant(const terrain_filter &, variant &)
config & add_child(const std::string &key)
static variant value_to_variant(const int &value)
static terrain_filter variant_to_value(const variant &var)
Managing the AIs lifecycle - headers.
static std::vector< std::string > cfg_to_value(const config &cfg)
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
Templates and utility-routines for strings and numbers.
std::string join(T const &v, const std::string &s=",")
Generates a new string joining container items in a list.
static T cfg_to_value(const config &cfg)
static bool cfg_to_value(const config &cfg)
static void variant_to_value(const variant &, attacks_vector &)
static variant value_to_variant(const bool &value)
const std::string & as_string() const
static config value_to_cfg(const bool &value)
static void value_to_variant(const std::string &value, variant &var)
static void value_to_variant(const bool &value, variant &var)
static void cfg_to_value(const config &cfg, unit_advancements_aspect &value)
static bool variant_to_value(const variant &var)
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
static void value_to_cfg(const T &value, config &cfg)
A variable-expanding proxy for the config class.
const std::string get_value() const
std::vector< std::string > split(std::string const &val, const char c, const int flags)
Splits a (comma-)separated string into a vector of pieces.
static void value_to_variant(const int &value, variant &var)
A config object defines a single node in a WML file, with access to child nodes.
static config value_to_cfg(const std::vector< std::string > &value)
static std::string variant_to_value(const variant &var)
static config value_to_cfg(const config &value)
GLsizei const GLcharARB ** string
static T variant_to_value(const variant &var)
static attacks_vector variant_to_value(const variant &var)