28 #include <boost/assign.hpp>
31 #define ERR_NG LOG_STREAM(err, log_engine)
32 #define WRN_NG LOG_STREAM(warn, log_engine)
33 #define LOG_NG LOG_STREAM(info, log_engine)
34 #define DBG_NG LOG_STREAM(debug, log_engine)
52 , variables_(level.child_or_empty(
"variables"))
54 , can_end_turn_(level[
"can_end_turn"].to_bool(true))
55 , next_scenario_(level[
"next_scenario"])
61 , scoped_variables(data.scoped_variables)
62 , last_selected(data.last_selected)
64 , variables_(data.variables_)
66 , can_end_turn_(data.can_end_turn_)
67 , next_scenario_(data.next_scenario_)
100 ERR_NG <<
"variable " << key <<
"cannot be set to " << value << std::endl;
106 std::vector<config> temp = {value};
148 bool recursive_activation =
false;
155 if(recursive_activation)
158 if(itor != var_name.end()) {
159 var_name.erase(itor, var_name.end());
161 std::vector<scoped_wml_variable*>::const_reverse_iterator rit;
166 if((**rit).name() == var_name) {
167 recursive_activation =
true;
168 if(!(**rit).activated()) {
171 recursive_activation =
false;
variable_info_detail::maybe_const< vit, config::attribute_value >::type & as_scalar() const
might throw invalid_variablename_exception NOTE: If vit == vit_const, then the lifime of the returned...
void activate_scope_variable(std::string var_name) const
void clear(bool only_tables=false) const
clears the vale this object points to if only_tables = true it will not clear attribute values...
config & get_variable_cfg(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
std::string get_random_seed_str() const
Variant for storing WML attributes.
config::attribute_value & get_variable(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
unsigned int get_random_calls() const
std::string next_scenario_
the scenario coming next (for campaigns)
virtual config::attribute_value get_variable_const(const std::string &varname) const
returns a blank attribute value if varname is no valid variable name.
void write_snapshot(config &cfg) const
variable_access_create get_variable_access_write(const std::string &varname)
returns a variable_access that can be used to change the game variables
GLsizei const GLfloat * value
void set_variable(const std::string &varname, const t_string &value)
does nothing if varname is no valid variable name.
config & add_child(const std::string &key)
variable_access_throw get_variable_access_throw(const std::string &varname)
Used to delete variables.
Templates and utility-routines for strings and numbers.
Encapsulates the map of the game.
variable_info_detail::maybe_const< vit, config >::type & as_container() const
might throw invalid_variablename_exception
std::vector< scoped_wml_variable * > scoped_variables
std::map< std::string, tfilter >::iterator itor
Information on a WML variable.
void clear_variable_cfg(const std::string &varname)
Clears only the config children does nothing if varname is no valid variable name.
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
bool find(E event, F functor)
Tests whether an event handler is available.
Standard logging facilities (interface).
static lg::log_domain log_engine("engine")
config::child_itors append_array(std::vector< config > childs) const
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.
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string