43 if(node.has_child(
"then")) {
51 bool elseif_flag =
false;
54 for(
const auto& elseif : elseif_children) {
56 if(elseif.has_child(
"then")) {
66 if(node.has_child(
"else") && !elseif_flag) {
72 else if(key ==
"switch") {
73 const std::string var_name = node[
"variable"];
75 bool case_not_found =
true;
77 for(
const auto& [switch_key, switch_node] : node.all_ordered()) {
78 if(switch_key !=
"case") {
83 const std::string var_expected_value = switch_node[
"value"];
84 if(var_actual_value == var_expected_value) {
85 case_not_found =
false;
91 for(
const auto& [else_key, else_node] : node.all_ordered()) {
92 if(else_key !=
"else") {
102 else if(key ==
"deprecated_message") {
108 else if(key ==
"wml_message") {
112 node[
"logger"], node[
"message"], node[
"in_chat"].to_bool(
false));
virtual config::attribute_value get_variable_const(const std::string &varname) const
returns a blank attribute value if varname is no valid variable name.
game_events::wml_event_pump & pump()
void put_wml_message(const std::string &logger, const std::string &message, bool in_chat)
Helper function which determines whether a wml_message text can really be pushed into the wml_message...
virtual void resolve_wml(const vconfig &cfg)
Takes care of initializing and branching properties.
virtual bool resolve_wml_helper(const std::string &key, const vconfig &node)=0
May be implemented by derived classes to perform additional actions When executing resolve_wml.
A variable-expanding proxy for the config class.
std::vector< vconfig > child_list
boost::iterator_range< all_children_iterator > all_ordered() const
Define conditionals for the game's events mechanism, a.k.a.
std::string deprecated_message(const std::string &elem_name, DEP_LEVEL level, const version_info &version, const std::string &detail)
DEP_LEVEL
See https://wiki.wesnoth.org/CompatibilityStandards for more info.
Interfaces for manipulating version numbers of engine, add-ons, etc.
bool conditional_passed(const vconfig &cond)
game_events::manager * game_events
Define the game's event mechanism.