Undoable action for overworld item mutations. More...
#include <overworld_undo_actions.h>


Public Types | |
| using | RestoreFn = std::function<void(const OverworldItemsSnapshot&)> |
Public Member Functions | |
| OverworldItemsEditAction (OverworldItemsSnapshot before, OverworldItemsSnapshot after, RestoreFn restore, std::string description) | |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| std::string | Description () const override |
| Human-readable description (e.g., "Paint 12 tiles on map 5") | |
| size_t | MemoryUsage () const override |
| Approximate memory footprint for budget enforcement. | |
| bool | CanMergeWith (const UndoAction &) const override |
Public Member Functions inherited from yaze::editor::UndoAction | |
| virtual | ~UndoAction ()=default |
| virtual void | MergeWith (UndoAction &) |
Private Attributes | |
| OverworldItemsSnapshot | before_ |
| OverworldItemsSnapshot | after_ |
| RestoreFn | restore_ |
| std::string | description_ |
Undoable action for overworld item mutations.
Stores before/after snapshots and applies them through a restore callback.
Definition at line 180 of file overworld_undo_actions.h.
| using yaze::editor::OverworldItemsEditAction::RestoreFn = std::function<void(const OverworldItemsSnapshot&)> |
Definition at line 182 of file overworld_undo_actions.h.
|
inline |
Definition at line 184 of file overworld_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 192 of file overworld_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 201 of file overworld_undo_actions.h.
|
inlineoverridevirtual |
Human-readable description (e.g., "Paint 12 tiles on map 5")
Implements yaze::editor::UndoAction.
Definition at line 210 of file overworld_undo_actions.h.
References description_.
|
inlineoverridevirtual |
Approximate memory footprint for budget enforcement.
Reimplemented from yaze::editor::UndoAction.
Definition at line 212 of file overworld_undo_actions.h.
References after_, before_, and yaze::editor::OverworldItemsSnapshot::items.
|
inlineoverridevirtual |
Whether this action can merge with the previous action on the stack. Called only when both actions have the same concrete type.
Reimplemented from yaze::editor::UndoAction.
Definition at line 220 of file overworld_undo_actions.h.
|
private |
Definition at line 223 of file overworld_undo_actions.h.
Referenced by MemoryUsage(), and Undo().
|
private |
Definition at line 224 of file overworld_undo_actions.h.
Referenced by MemoryUsage(), and Redo().
|
private |
Definition at line 225 of file overworld_undo_actions.h.
|
private |
Definition at line 226 of file overworld_undo_actions.h.
Referenced by Description().