The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
undo_recall_action.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "undo_action.hpp"
5 #include "units/ptr.hpp"
6 #include "units/unit.hpp"
7 
8 namespace actions
9 {
10 namespace undo
11 {
12 
13 
15 {
18 
19 
20  recall_action(const unit_const_ptr recalled, const map_location& loc,
21  const map_location& from, int orig_village_owner, bool time_bonus)
22  : undo_action()
23  , shroud_clearing_action(recalled, loc, orig_village_owner, time_bonus)
24  , id(recalled->id())
25  , recall_from(from)
26  {
27  }
28  recall_action(const config & cfg, const map_location & from)
29  : undo_action(cfg)
31  , id(cfg["id"])
32  , recall_from(from)
33  {}
34  virtual const char* get_type() const { return "recall"; }
35  virtual ~recall_action() {}
36 
37  /// Writes this into the provided config.
38  virtual void write(config & cfg) const;
39 
40  /// Undoes this action.
41  virtual bool undo(int side);
42  /// Redoes this action.
43  virtual bool redo(int side);
44 };
45 
46 }
47 }
base class for classes that clear srhoud (move/recruit/recall)
virtual bool undo(int side)
Undoes this action.
virtual bool redo(int side)
Redoes this action.
Encapsulates the map of the game.
Definition: location.hpp:38
virtual const char * get_type() const
recall_action(const config &cfg, const map_location &from)
recall_action(const unit_const_ptr recalled, const map_location &loc, const map_location &from, int orig_village_owner, bool time_bonus)
virtual void write(config &cfg) const
Writes this into the provided config.
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
GLsizei const GLcharARB ** string
Definition: glew.h:4503
actions that are undoable (this does not include update_shroud and auto_shroud)
Definition: undo_action.hpp:47