Variant for storing WML attributes.
A config object defines a single node in a WML file, with access to child nodes.
void clear_variable(const std::string &varname)
Clears attributes config children does nothing if varname is no valid variable name.
std::vector< scoped_wml_variable * > scoped_variables
const std::string & get_id() const
bool allow_end_turn() const
t_string cannot_end_turn_reason_
virtual config::attribute_value get_variable_const(const std::string &varname) const
returns a blank attribute value if varname is no valid variable name.
const t_string & cannot_end_turn_reason()
void set_end_turn_forced(bool v)
void set_phase(PHASE phase)
bool is_before_screen() const
void clear_variable_cfg(const std::string &varname)
Clears only the config children does nothing if varname is no valid variable name.
const config & get_variables() const
void set_defeat_music(std::vector< std::string > value)
@ PRELOAD
the preload [event] is fired next phase: PRESTART (normal game), TURN_STARTING_WAITING (reloaded game...
@ INITIAL
creating intitial [unit]s, executing toplevel [lua] etc.
@ GAME_ENDED
The game has ended and the user is observing the final state "lingering" The game can be saved here.
@ PRESTART
the prestart [event] is fired next phase: START (default), GAME_ENDING
@ TURN_PLAYING
The User is controlling the game and invoking actions The game can be saved here.
@ TURN_ENDED
The turn_end, side_turn_end etc [events] are fired next phase: TURN_STARTING_WAITING (default),...
@ TURN_STARTING_WAITING
we are waiting for the turn to start.
@ START
the start [event] is fired next phase: TURN_STARTING_WAITING (default), GAME_ENDING
@ GAME_ENDING
The victory etc.
@ TURN_STARTING
the turn, side turn etc.
static PHASE read_phase(const config &cfg)
const std::string & get_theme() 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
bool has_current_player() const
returns where there is currently a well defiend "current player", that is for example not the case du...
map_location last_selected
the last location where a select event fired.
variable_access_create get_variable_access_write(const std::string &varname)
returns a variable_access that can be used to change the game variables
config & get_variable_cfg(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
void set_theme(const std::string &value)
void set_allow_end_turn(bool value, const t_string &reason="")
bool end_turn_forced() const
const randomness::mt_rng & rng() const
randomness::mt_rng & rng()
void set_next_scenario(const std::string &next_scenario)
void write_snapshot(config &cfg) const
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
void set_victory_music(std::vector< std::string > value)
const std::vector< std::string > & get_victory_music() const
static void write_phase(config &cfg, game_data::PHASE phase)
void set_id(const std::string &value)
config::attribute_value & get_variable(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
const std::vector< std::string > & get_defeat_music() const
config & add_variable_cfg(const std::string &varname, const config &value=config())
throws invalid_variablename_exception if varname is no valid variable name.
std::vector< std::string > victory_music_
game_data(const config &level)
std::string next_scenario_
the scenario coming next (for campaigns)
const std::string & next_scenario() const
std::vector< std::string > defeat_music_
bool is_after_start() const
void set_variable(const std::string &varname, const t_string &value)
does nothing if varname is no valid variable name.
Additional functionality for a non-const variable_info.
Information on a WML variable.
Definitions for the interface to Wesnoth Markup Language (WML).
Contains the exception interfaces used to signal completion of a scenario, campaign or turn.
Encapsulates the map of the game.
variable_info< const variable_info_implementation::vi_policy_const > variable_access_const
Read-only access.
variable_info_mutable< variable_info_implementation::vi_policy_throw > variable_access_throw
'Throw if nonexistent' access.
variable_info_mutable< variable_info_implementation::vi_policy_create > variable_access_create
'Create if nonexistent' access.