28 #define ERR_NG LOG_STREAM(err, log_engine) 29 #define WRN_NG LOG_STREAM(warn, log_engine) 30 #define LOG_NG LOG_STREAM(info, log_engine) 31 #define DBG_NG LOG_STREAM(debug, log_engine) 38 , variables_(level.child_or_empty(
"variables"))
40 , can_end_turn_(level[
"can_end_turn"].to_bool(true))
41 , next_scenario_(level[
"next_scenario"])
43 , theme_(level[
"theme"])
44 , defeat_music_(
utils::
split(level[
"defeat_music"]))
45 , victory_music_(
utils::
split(level[
"victory_music"]))
91 ERR_NG <<
"variable " << key <<
"cannot be set to " << value << std::endl;
97 std::vector<config> temp {value};
143 bool recursive_activation =
false;
149 if (recursive_activation) {
154 if(itor != var_name.end()) {
155 var_name.erase(itor, var_name.end());
159 if (v->name() == var_name) {
160 recursive_activation =
true;
161 if (!v->activated()) {
164 recursive_activation =
false;
map_location last_selected
the last location where a select event fired.
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
Variant for storing WML attributes.
config & get_variable_cfg(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
maybe_const_t< config::attribute_value, V > & as_scalar() const
If instantiated with vi_policy_const, the lifetime of the returned const attribute_value reference mi...
auto reversed_view(T &container)
maybe_const_t< config, V > & as_container() const
If instantiated with vi_policy_const, the lifetime of the returned const attribute_value reference mi...
config::attribute_value & get_variable(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
std::string get_random_seed_str() const
std::string next_scenario_
the scenario coming next (for campaigns)
variable_access_create get_variable_access_write(const std::string &varname)
returns a variable_access that can be used to change the game variables
void set_variable(const std::string &varname, const t_string &value)
does nothing if varname is no valid variable name.
config::child_itors append_array(std::vector< config > children) const
variable_access_throw get_variable_access_throw(const std::string &varname)
Used to delete variables.
void activate_scope_variable(std::string var_name) const
Encapsulates the map of the game.
unsigned int get_random_calls() const
std::vector< scoped_wml_variable * > scoped_variables
void clear_variable_cfg(const std::string &varname)
Clears only the config children does nothing if varname is no valid variable name.
void clear(bool only_tables=false) const
Clears the value this object points to.
config & add_child(config_key_type key)
std::vector< std::string > defeat_music_
virtual config::attribute_value get_variable_const(const std::string &varname) const
returns a blank attribute value if varname is no valid variable name.
std::vector< std::string > victory_music_
std::vector< std::string > split(const config_attribute_value &val)
Standard logging facilities (interface).
static lg::log_domain log_engine("engine")
config & add_variable_cfg(const std::string &varname, const config &value=config())
throws invalid_variablename_exception if varname is no valid variable name.
void clear_variable(const std::string &varname)
Clears attributes config children does nothing if varname is no valid variable name.
void write_snapshot(config &cfg) const
config_attribute_value attribute_value
Variant for storing WML attributes.
A config object defines a single node in a WML file, with access to child nodes.
std::string::const_iterator iterator
game_data(const config &level)
variable_access_const get_variable_access_read(const std::string &varname) const
returns a variable_access that cannot be used to change the game variables