Undoable action for dungeon room object edits. More...
#include <dungeon_undo_actions.h>


Public Types | |
| using | RestoreFn |
Public Member Functions | |
| DungeonObjectsAction (int room_id, std::vector< zelda3::RoomObject > before, std::vector< size_t > before_selection, std::vector< zelda3::RoomObject > after, std::vector< size_t > after_selection, std::vector< chest_data > before_chests, std::vector< chest_data > after_chests, RestoreFn restore) | |
| 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 | |
| int | room_id_ |
| std::vector< zelda3::RoomObject > | before_ |
| std::vector< size_t > | before_selection_ |
| std::vector< zelda3::RoomObject > | after_ |
| std::vector< size_t > | after_selection_ |
| std::vector< chest_data > | before_chests_ |
| std::vector< chest_data > | after_chests_ |
| RestoreFn | restore_ |
Undoable action for dungeon room object edits.
Captures a full snapshot of a room's tile objects, chest contents and selection before and after an editing operation. Undo restores the before-state, Redo restores the after-state, using a caller-provided restore callback that applies the snapshot back into the room.
Definition at line 31 of file dungeon_undo_actions.h.
Definition at line 33 of file dungeon_undo_actions.h.
|
inline |
Definition at line 38 of file dungeon_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 53 of file dungeon_undo_actions.h.
References before_, before_chests_, before_selection_, restore_, and room_id_.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 60 of file dungeon_undo_actions.h.
References after_, after_chests_, after_selection_, restore_, and room_id_.
|
inlineoverridevirtual |
Human-readable description (e.g., "Paint 12 tiles on map 5")
Implements yaze::editor::UndoAction.
Definition at line 67 of file dungeon_undo_actions.h.
References room_id_.
|
inlineoverridevirtual |
Approximate memory footprint for budget enforcement.
Reimplemented from yaze::editor::UndoAction.
Definition at line 71 of file dungeon_undo_actions.h.
References after_, after_chests_, after_selection_, before_, before_chests_, and before_selection_.
|
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 79 of file dungeon_undo_actions.h.
|
private |
Definition at line 86 of file dungeon_undo_actions.h.
Referenced by Description(), Redo(), and Undo().
|
private |
Definition at line 87 of file dungeon_undo_actions.h.
Referenced by MemoryUsage(), and Undo().
|
private |
Definition at line 88 of file dungeon_undo_actions.h.
Referenced by MemoryUsage(), and Undo().
|
private |
Definition at line 89 of file dungeon_undo_actions.h.
Referenced by MemoryUsage(), and Redo().
|
private |
Definition at line 90 of file dungeon_undo_actions.h.
Referenced by MemoryUsage(), and Redo().
|
private |
Definition at line 91 of file dungeon_undo_actions.h.
Referenced by MemoryUsage(), and Undo().
|
private |
Definition at line 91 of file dungeon_undo_actions.h.
Referenced by MemoryUsage(), and Redo().
|
private |
Definition at line 92 of file dungeon_undo_actions.h.