The Battle for Wesnoth  1.15.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 "game_events/conditional_wml.hpp"
#include "game_events/pump.hpp"
#include "actions/attack.hpp"
#include "actions/create.hpp"
#include "actions/move.hpp"
#include "actions/vision.hpp"
#include "ai/manager.hpp"
#include "fake_unit_ptr.hpp"
#include "filesystem.hpp"
#include "game_classification.hpp"
#include "game_display.hpp"
#include "preferences/game.hpp"
#include "gettext.hpp"
#include "gui/dialogs/transient_message.hpp"
#include "gui/widgets/retval.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "map/exception.hpp"
#include "map/label.hpp"
#include "pathfind/teleport.hpp"
#include "pathfind/pathfind.hpp"
#include "persist_var.hpp"
#include "play_controller.hpp"
#include "recall_list_manager.hpp"
#include "replay.hpp"
#include "random.hpp"
#include "mouse_handler_base.hpp"
#include "resources.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "side_filter.hpp"
#include "soundsource.hpp"
#include "synced_context.hpp"
#include "synced_user_choice.hpp"
#include "team.hpp"
#include "terrain/filter.hpp"
#include "units/unit.hpp"
#include "units/animation_component.hpp"
#include "units/udisplay.hpp"
#include "units/filter.hpp"
#include "wml_exception.hpp"
#include "whiteboard/manager.hpp"
#include "deprecation.hpp"
#include <boost/regex.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, bool)
 
 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 (store_time_of_day,, cfg)
 Store time of day config 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...
 
 game_events::WML_HANDLER_FUNCTION (on_undo, event_info, cfg)
 

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 75 of file action_wml.cpp.

◆ DBG_NG

#define DBG_NG   LOG_STREAM(debug, log_engine)

Definition at line 69 of file action_wml.cpp.

Referenced by game_events::WML_HANDLER_FUNCTION().

◆ ERR_CF

#define ERR_CF   LOG_STREAM(err, log_config)

Definition at line 84 of file action_wml.cpp.

◆ ERR_NG

#define ERR_NG   LOG_STREAM(err, log_engine)

◆ ERR_WML

#define ERR_WML   LOG_STREAM(err, log_wml)

Definition at line 81 of file action_wml.cpp.

Referenced by game_events::WML_HANDLER_FUNCTION().

◆ LOG_DP

#define LOG_DP   LOG_STREAM(info, log_display)

Definition at line 76 of file action_wml.cpp.

◆ LOG_NG

#define LOG_NG   LOG_STREAM(info, log_engine)

Definition at line 70 of file action_wml.cpp.

Referenced by game_events::WML_HANDLER_FUNCTION().

◆ LOG_WML

#define LOG_WML   LOG_STREAM(info, log_wml)

Definition at line 79 of file action_wml.cpp.

Referenced by game_events::WML_HANDLER_FUNCTION().

◆ 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:42

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
}

Generated code looks like this:

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

Definition at line 251 of file action_wml.cpp.

◆ WRN_NG

#define WRN_NG   LOG_STREAM(warn, log_engine)

Definition at line 71 of file action_wml.cpp.

Referenced by game_events::WML_HANDLER_FUNCTION().

◆ WRN_WML

#define WRN_WML   LOG_STREAM(warn, log_wml)

Definition at line 80 of file action_wml.cpp.

Variable Documentation

◆ filename_

std::string filename_

◆ log_config

lg::log_domain log_config("config")
static

◆ log_display

lg::log_domain log_display("display")
static

◆ log_engine

lg::log_domain log_engine("engine")
static

◆ log_wml

lg::log_domain log_wml("wml")
static