The Battle for Wesnoth  1.19.7+dev
Classes | Namespaces | Macros
action_base.hpp File Reference

Base class for editor actions. More...

#include "editor/editor_common.hpp"
Include dependency graph for action_base.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  editor::editor_action
 Base class for all editor actions. More...
 
struct  editor::editor_action_exception
 

Namespaces

 editor
 Manage the empty-palette in the editor.
 

Macros

#define IMPLEMENT_ACTION(id)
 Helper macro to implement common action methods. More...
 

Detailed Description

Base class for editor actions.

An action is constructed in response to a user command, then executed on the map. An undo action is returned by default via pointer, caller-owned). It is possible to call an action without creating the undo action. Actions report failure via exceptions. Code that only deals with actions polymorphically should only need to include this header file.

Definition in file action_base.hpp.

Macro Definition Documentation

◆ IMPLEMENT_ACTION

#define IMPLEMENT_ACTION (   id)
Value:
\
const std::string& editor_action_##id::get_name() const \
{ \
static const std::string name(#id); \
return name; \
} \
\
std::unique_ptr<editor_action> editor_action_##id::clone() const \
{ \
return std::make_unique<editor_action_##id>(*this); \
} \

Helper macro to implement common action methods.

Definition at line 125 of file action_base.hpp.