The Battle for Wesnoth  1.19.7+dev
Namespaces | Macros | Functions | Variables
conditional_wml.cpp File Reference

Implementations of conditional action WML tags. More...

#include "game_events/conditional_wml.hpp"
#include "config.hpp"
#include "game_board.hpp"
#include "game_data.hpp"
#include "log.hpp"
#include "recall_list_manager.hpp"
#include "resources.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "serialization/string_utils.hpp"
#include "team.hpp"
#include "terrain/filter.hpp"
#include "units/unit.hpp"
#include "units/filter.hpp"
#include "units/map.hpp"
#include "variable.hpp"
Include dependency graph for conditional_wml.cpp:

Go to the source code of this file.

Namespaces

 game_events
 Domain specific events.
 
 game_events::builtin_conditions
 

Macros

#define WRN_NG   LOG_STREAM(warn, log_engine)
 
#define ERR_WML   LOG_STREAM(err, log_wml)
 
#define TEST_STR_ATTR(name, test)
 
#define TEST_NUM_ATTR(name, test)
 
#define TEST_BOL_ATTR(name, test)
 

Functions

bool game_events::builtin_conditions::have_unit (const vconfig &cfg)
 
bool game_events::builtin_conditions::have_location (const vconfig &cfg)
 
bool game_events::builtin_conditions::variable_matches (const vconfig &values)
 
bool game_events::conditional_passed (const vconfig &cond)
 

Variables

static lg::log_domain log_engine ("engine")
 
static lg::log_domain log_wml ("wml")
 
std::vector< std::pair< int, int > > game_events::builtin_conditions::default_counts = utils::parse_ranges_unsigned("1-infinity")
 

Detailed Description

Implementations of conditional action WML tags.

Definition in file conditional_wml.cpp.

Macro Definition Documentation

◆ ERR_WML

#define ERR_WML   LOG_STREAM(err, log_wml)

Definition at line 42 of file conditional_wml.cpp.

◆ TEST_BOL_ATTR

#define TEST_BOL_ATTR (   name,
  test 
)
Value:
do { \
if (values.has_attribute(name)) { \
bool attr_bool = values[name].to_bool(); \
bool bool_value = value.to_bool(); \
return (test); \
} \
} while (0)
constexpr auto values
Definition: ranges.hpp:42

◆ TEST_NUM_ATTR

#define TEST_NUM_ATTR (   name,
  test 
)
Value:
do { \
if (values.has_attribute(name)) { \
double attr_num = values[name].to_double(); \
double num_value = value.to_double(); \
return (test); \
} \
} while (0)

◆ TEST_STR_ATTR

#define TEST_STR_ATTR (   name,
  test 
)
Value:
do { \
if (values.has_attribute(name)) { \
std::string attr_str = values[name].str(); \
std::string str_value = value.str(); \
return (test); \
} \
} while (0)

◆ WRN_NG

#define WRN_NG   LOG_STREAM(warn, log_engine)

Definition at line 39 of file conditional_wml.cpp.

Variable Documentation

◆ log_engine

lg::log_domain log_engine("engine") ( "engine"  )
static

◆ log_wml

lg::log_domain log_wml("wml") ( "wml"  )
static