The Battle for Wesnoth  1.19.0-dev
Namespaces | Macros | Functions | Variables
action_wml.cpp File Reference

Implementations of action WML tags, other than those implemented in Lua, and excluding conditional action WML. More...

#include "game_events/action_wml.hpp"
#include "actions/create.hpp"
#include "ai/manager.hpp"
#include "fake_unit_ptr.hpp"
#include "filesystem.hpp"
#include "game_display.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "map/exception.hpp"
#include "pathfind/teleport.hpp"
#include "pathfind/pathfind.hpp"
#include "persist_var.hpp"
#include "play_controller.hpp"
#include "recall_list_manager.hpp"
#include "mouse_handler_base.hpp"
#include "resources.hpp"
#include "synced_context.hpp"
#include "synced_user_choice.hpp"
#include "team.hpp"
#include "units/unit.hpp"
#include "units/animation_component.hpp"
#include "units/udisplay.hpp"
#include "units/filter.hpp"
#include "units/types.hpp"
#include "wml_exception.hpp"
#include "whiteboard/manager.hpp"
#include "deprecation.hpp"
Include dependency graph for action_wml.cpp:

Go to the source code of this file.

Namespaces

 game_events
 Domain specific events.
 

Macros

#define DBG_NG   LOG_STREAM(debug, log_engine)
 
#define LOG_NG   LOG_STREAM(info, log_engine)
 
#define WRN_NG   LOG_STREAM(warn, log_engine)
 
#define ERR_NG   LOG_STREAM(err, log_engine)
 
#define DBG_DP   LOG_STREAM(debug, log_display)
 
#define LOG_DP   LOG_STREAM(info, log_display)
 
#define LOG_WML   LOG_STREAM(info, log_wml)
 
#define WRN_WML   LOG_STREAM(warn, log_wml)
 
#define ERR_WML   LOG_STREAM(err, log_wml)
 
#define ERR_CF   LOG_STREAM(err, log_config)
 
#define WML_HANDLER_FUNCTION(pname, pei, pcfg)
 WML_HANDLER_FUNCTION macro handles auto registration for wml handlers. More...
 

Functions

 game_events::WML_HANDLER_FUNCTION (clear_global_variable,, pcfg)
 Experimental data persistence. More...
 
static void game_events::on_replay_error (const std::string &message)
 
 game_events::WML_HANDLER_FUNCTION (do_command,, cfg)
 
 game_events::WML_HANDLER_FUNCTION (get_global_variable,, pcfg)
 Experimental data persistence. More...
 
 game_events::WML_HANDLER_FUNCTION (modify_turns,, cfg)
 
 game_events::WML_HANDLER_FUNCTION (move_unit_fake,, cfg)
 Moving a 'unit' - i.e. More...
 
 game_events::WML_HANDLER_FUNCTION (move_units_fake,, cfg)
 
 game_events::WML_HANDLER_FUNCTION (recall,, cfg)
 If we should recall units that match a certain description. More...
 
 game_events::WML_HANDLER_FUNCTION (replace_map,, cfg)
 Experimental map replace. More...
 
 game_events::WML_HANDLER_FUNCTION (set_global_variable,, pcfg)
 Experimental data persistence. More...
 
 game_events::WML_HANDLER_FUNCTION (set_variables,, cfg)
 
 game_events::WML_HANDLER_FUNCTION (store_relative_direction,, cfg)
 Store the relative direction from one hex to another in a WML variable. More...
 
 game_events::WML_HANDLER_FUNCTION (store_rotate_map_location,, cfg)
 Store the rotation of one hex around another in a WML variable. More...
 
 game_events::WML_HANDLER_FUNCTION (tunnel,, cfg)
 
 game_events::WML_HANDLER_FUNCTION (unit,, cfg)
 If we should spawn a new unit on the map somewhere. More...
 

Variables

static lg::log_domain log_engine ("engine")
 
static lg::log_domain log_display ("display")
 
static lg::log_domain log_wml ("wml")
 
static lg::log_domain log_config ("config")
 

Detailed Description

Implementations of action WML tags, other than those implemented in Lua, and excluding conditional action WML.

Definition in file action_wml.cpp.

Macro Definition Documentation

◆ DBG_DP

#define DBG_DP   LOG_STREAM(debug, log_display)

Definition at line 58 of file action_wml.cpp.

◆ DBG_NG

#define DBG_NG   LOG_STREAM(debug, log_engine)

Definition at line 52 of file action_wml.cpp.

◆ ERR_CF

#define ERR_CF   LOG_STREAM(err, log_config)

Definition at line 67 of file action_wml.cpp.

◆ ERR_NG

#define ERR_NG   LOG_STREAM(err, log_engine)

Definition at line 55 of file action_wml.cpp.

◆ ERR_WML

#define ERR_WML   LOG_STREAM(err, log_wml)

Definition at line 64 of file action_wml.cpp.

◆ LOG_DP

#define LOG_DP   LOG_STREAM(info, log_display)

Definition at line 59 of file action_wml.cpp.

◆ LOG_NG

#define LOG_NG   LOG_STREAM(info, log_engine)

Definition at line 53 of file action_wml.cpp.

◆ LOG_WML

#define LOG_WML   LOG_STREAM(info, log_wml)

Definition at line 62 of file action_wml.cpp.

◆ WML_HANDLER_FUNCTION

#define WML_HANDLER_FUNCTION (   pname,
  pei,
  pcfg 
)
Value:
static void wml_func_##pname(const queued_event& pei, const vconfig& pcfg); \
static wml_action wml_action_##pname(#pname, &wml_func_##pname); \
static void wml_func_##pname(const queued_event& pei, const vconfig& pcfg)
A variable-expanding proxy for the config class.
Definition: variable.hpp:45

WML_HANDLER_FUNCTION macro handles auto registration for wml handlers.

Parameters
pnamewml tag name
peithe variable name of the queued_event object inside the function
pcfgthe variable name of the config object inside the function

You are warned! This is evil macro magic!

The following code registers a [foo] tag:

// comment out unused parameters to prevent compiler warnings
WML_HANDLER_FUNCTION(foo, event_info, cfg)
{
// code for foo
}
#define WML_HANDLER_FUNCTION(pname, pei, pcfg)
WML_HANDLER_FUNCTION macro handles auto registration for wml handlers.
Definition: action_wml.cpp:234

Generated code looks like this:

static void wml_func_foo(...);
static wml_action wml_action_foo("foo", &wml_func_foo);
static void wml_func_foo(...)
{
// code for foo
}

Definition at line 234 of file action_wml.cpp.

◆ WRN_NG

#define WRN_NG   LOG_STREAM(warn, log_engine)

Definition at line 54 of file action_wml.cpp.

◆ WRN_WML

#define WRN_WML   LOG_STREAM(warn, log_wml)

Definition at line 63 of file action_wml.cpp.

Variable Documentation

◆ filename_

std::string filename_

◆ log_config

lg::log_domain log_config("config") ( "config"  )
static

◆ log_display

lg::log_domain log_display("display") ( "display"  )
static

◆ log_engine

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

◆ log_wml

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