actions that are undoable (this does not include update_shroud and auto_shroud) More...
#include <undo_action.hpp>
Public Types | |
typedef std::vector< undo_event > | event_vector |
actions wml (specified by wml) that should be executed when undoing this command. More... | |
Public Member Functions | |
undo_action () | |
Default constructor. More... | |
undo_action (const config &cfg) | |
virtual | ~undo_action () |
virtual void | write (config &cfg) const |
Writes this into the provided config. More... | |
virtual bool | undo (int side)=0 |
Undoes this action. More... | |
void | execute_undo_umc_wml () |
Public Member Functions inherited from actions::undo_action_base | |
undo_action_base (const undo_action_base &)=delete | |
undo_action_base & | operator= (const undo_action_base &)=delete |
undo_action_base () | |
Default constructor. More... | |
virtual | ~undo_action_base () |
virtual const char * | get_type () const =0 |
Static Public Member Functions | |
static void | read_event_vector (event_vector &vec, const config &cfg, const std::string &tag) |
static void | write_event_vector (const event_vector &vec, config &cfg, const std::string &tag) |
Public Attributes | |
int | unit_id_diff |
the difference in the unit ids TODO: does it really make sense to allow undoing if the unit id counter has changed? More... | |
event_vector | umc_commands_undo |
actions that are undoable (this does not include update_shroud and auto_shroud)
Definition at line 65 of file undo_action.hpp.
typedef std::vector<undo_event> actions::undo_action::event_vector |
actions wml (specified by wml) that should be executed when undoing this command.
Definition at line 91 of file undo_action.hpp.
actions::undo_action::undo_action | ( | ) |
Default constructor.
It is assumed that undo actions are constructed after the action is performed so that the unit id diff does not change after this constructor
Definition at line 87 of file undo_action.cpp.
References synced_context::get_undo_commands(), p, umc_commands_undo, and undo().
actions::undo_action::undo_action | ( | const config & | cfg | ) |
Definition at line 103 of file undo_action.cpp.
References read_event_vector(), and umc_commands_undo.
|
inlinevirtual |
Definition at line 75 of file undo_action.hpp.
void actions::undo_action::execute_undo_umc_wml | ( | ) |
Definition at line 155 of file undo_action.cpp.
References e, and umc_commands_undo.
Referenced by actions::undo::dismiss_action::undo(), actions::undo::move_action::undo(), actions::undo::recall_action::undo(), actions::undo::recruit_action::undo(), and actions::undo_dummy_action::undo().
|
static |
Definition at line 171 of file undo_action.cpp.
References c, config::child_range(), and markup::tag().
Referenced by undo_action().
|
pure virtual |
Undoes this action.
Implemented in actions::undo_dummy_action, actions::undo::recruit_action, actions::undo::recall_action, actions::undo::move_action, and actions::undo::dismiss_action.
Referenced by undo_action().
|
virtual |
Writes this into the provided config.
Reimplemented from actions::undo_action_base.
Reimplemented in actions::undo::recruit_action, actions::undo::recall_action, actions::undo::move_action, and actions::undo::dismiss_action.
Definition at line 164 of file undo_action.cpp.
References umc_commands_undo, unit_id_diff, actions::undo_action_base::write(), and write_event_vector().
Referenced by actions::undo::dismiss_action::write(), actions::undo::move_action::write(), actions::undo::recall_action::write(), and actions::undo::recruit_action::write().
|
static |
Definition at line 178 of file undo_action.cpp.
References config::add_child(), and markup::tag().
Referenced by write().
event_vector actions::undo_action::umc_commands_undo |
Definition at line 92 of file undo_action.hpp.
Referenced by execute_undo_umc_wml(), undo_action(), and write().
int actions::undo_action::unit_id_diff |
the difference in the unit ids TODO: does it really make sense to allow undoing if the unit id counter has changed?
Definition at line 89 of file undo_action.hpp.
Referenced by write().