Abstract base for all undoable actions (Command pattern) More...
#include <undo_action.h>
Inherited by yaze::editor::DungeonCustomCollisionAction, yaze::editor::DungeonCustomCollisionBatchAction, yaze::editor::DungeonEntitiesAction, yaze::editor::DungeonObjectsAction, yaze::editor::DungeonWaterFillAction, yaze::editor::GraphicsPixelEditAction, yaze::editor::GraphicsScratchView::LibraryEdit, yaze::editor::MessageEditAction, yaze::editor::MusicSongEditAction, yaze::editor::OverworldItemsEditAction, yaze::editor::OverworldMapPropertyBatchEditAction, yaze::editor::OverworldMapPropertyEditAction, yaze::editor::OverworldProjectLabelEditAction, yaze::editor::OverworldRecordEditAction< Record >, yaze::editor::OverworldTilePaintAction, yaze::editor::ScreenEditAction, yaze::editor::SpriteEditAction, yaze::editor::Tile16EditAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_chest_edits.cc}::ChestContentsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntranceCameraRepairAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::CartStartAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::RailObjectsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart_nodes.cc}::MinecartNodeAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_edits.cc}::RoomMetadataAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_transfer.cc}::RoomTransferAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_selection_edits.cc}::DungeonSelectionAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_undo.cc}::RoomGraphicsSheetAction, yaze::editor::anonymous_namespace{gfx_group_editor_main.cc}::GraphicsSheetAssignmentAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::AuthoringAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::TerrainStrokeAction, yaze::editor::anonymous_namespace{overworld_editor.cc}::LyraTerrainPaintAction, yaze::editor::anonymous_namespace{palette_pixel_command.cc}::PalettePixelAction, yaze::editor::anonymous_namespace{pixel_index_command.cc}::PixelIndexAction, yaze::editor::anonymous_namespace{project_graphics_import_command.cc}::ProjectGraphicsImportAction, yaze::editor::anonymous_namespace{scratch_space.cc}::ScratchWorkspaceUndoAction, and yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction.
Public Member Functions | |
| virtual | ~UndoAction ()=default |
| virtual absl::Status | Undo ()=0 |
| virtual absl::Status | Redo ()=0 |
| virtual std::string | Description () const =0 |
| Human-readable description (e.g., "Paint 12 tiles on map 5") | |
| virtual size_t | MemoryUsage () const |
| Approximate memory footprint for budget enforcement. | |
| virtual bool | CanMergeWith (const UndoAction &) const |
| virtual void | MergeWith (UndoAction &) |
Abstract base for all undoable actions (Command pattern)
Each concrete action captures enough state to undo and redo itself. Actions may optionally merge with previous actions of the same type (e.g., sequential tile paints become a single undo step).
Definition at line 20 of file undo_action.h.
|
virtualdefault |
|
pure virtual |
Implemented in yaze::editor::anonymous_namespace{dungeon_editor_v2_chest_edits.cc}::ChestContentsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntranceCameraRepairAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::CartStartAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::RailObjectsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart_nodes.cc}::MinecartNodeAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_edits.cc}::RoomMetadataAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_transfer.cc}::RoomTransferAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_selection_edits.cc}::DungeonSelectionAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_undo.cc}::RoomGraphicsSheetAction, yaze::editor::DungeonObjectsAction, yaze::editor::DungeonEntitiesAction, yaze::editor::DungeonCustomCollisionAction, yaze::editor::DungeonCustomCollisionBatchAction, yaze::editor::DungeonWaterFillAction, yaze::editor::anonymous_namespace{gfx_group_editor_main.cc}::GraphicsSheetAssignmentAction, yaze::editor::GraphicsPixelEditAction, yaze::editor::anonymous_namespace{palette_pixel_command.cc}::PalettePixelAction, yaze::editor::anonymous_namespace{pixel_index_command.cc}::PixelIndexAction, yaze::editor::ScreenEditAction, yaze::editor::GraphicsScratchView::LibraryEdit, yaze::editor::MessageEditAction, yaze::editor::MusicSongEditAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::TerrainStrokeAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::AuthoringAction, yaze::editor::anonymous_namespace{overworld_editor.cc}::LyraTerrainPaintAction, yaze::editor::OverworldTilePaintAction, yaze::editor::OverworldRecordEditAction< Record >, yaze::editor::OverworldItemsEditAction, yaze::editor::OverworldMapPropertyEditAction, yaze::editor::OverworldMapPropertyBatchEditAction, yaze::editor::OverworldProjectLabelEditAction, yaze::editor::anonymous_namespace{project_graphics_import_command.cc}::ProjectGraphicsImportAction, yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction, yaze::editor::Tile16EditAction, yaze::editor::anonymous_namespace{scratch_space.cc}::ScratchWorkspaceUndoAction, and yaze::editor::SpriteEditAction.
|
pure virtual |
Implemented in yaze::editor::anonymous_namespace{dungeon_editor_v2_chest_edits.cc}::ChestContentsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntranceCameraRepairAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::CartStartAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::RailObjectsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart_nodes.cc}::MinecartNodeAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_edits.cc}::RoomMetadataAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_transfer.cc}::RoomTransferAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_selection_edits.cc}::DungeonSelectionAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_undo.cc}::RoomGraphicsSheetAction, yaze::editor::DungeonObjectsAction, yaze::editor::DungeonEntitiesAction, yaze::editor::DungeonCustomCollisionAction, yaze::editor::DungeonCustomCollisionBatchAction, yaze::editor::DungeonWaterFillAction, yaze::editor::anonymous_namespace{gfx_group_editor_main.cc}::GraphicsSheetAssignmentAction, yaze::editor::GraphicsPixelEditAction, yaze::editor::anonymous_namespace{palette_pixel_command.cc}::PalettePixelAction, yaze::editor::anonymous_namespace{pixel_index_command.cc}::PixelIndexAction, yaze::editor::ScreenEditAction, yaze::editor::GraphicsScratchView::LibraryEdit, yaze::editor::MessageEditAction, yaze::editor::MusicSongEditAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::TerrainStrokeAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::AuthoringAction, yaze::editor::anonymous_namespace{overworld_editor.cc}::LyraTerrainPaintAction, yaze::editor::OverworldTilePaintAction, yaze::editor::OverworldRecordEditAction< Record >, yaze::editor::OverworldItemsEditAction, yaze::editor::OverworldMapPropertyEditAction, yaze::editor::OverworldMapPropertyBatchEditAction, yaze::editor::OverworldProjectLabelEditAction, yaze::editor::anonymous_namespace{project_graphics_import_command.cc}::ProjectGraphicsImportAction, yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction, yaze::editor::Tile16EditAction, yaze::editor::anonymous_namespace{scratch_space.cc}::ScratchWorkspaceUndoAction, and yaze::editor::SpriteEditAction.
|
pure virtual |
Human-readable description (e.g., "Paint 12 tiles on map 5")
Implemented in yaze::editor::anonymous_namespace{dungeon_editor_v2_chest_edits.cc}::ChestContentsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntranceCameraRepairAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::CartStartAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::RailObjectsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart_nodes.cc}::MinecartNodeAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_edits.cc}::RoomMetadataAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_transfer.cc}::RoomTransferAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_selection_edits.cc}::DungeonSelectionAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_undo.cc}::RoomGraphicsSheetAction, yaze::editor::DungeonObjectsAction, yaze::editor::DungeonEntitiesAction, yaze::editor::DungeonCustomCollisionAction, yaze::editor::DungeonCustomCollisionBatchAction, yaze::editor::DungeonWaterFillAction, yaze::editor::anonymous_namespace{gfx_group_editor_main.cc}::GraphicsSheetAssignmentAction, yaze::editor::GraphicsPixelEditAction, yaze::editor::anonymous_namespace{palette_pixel_command.cc}::PalettePixelAction, yaze::editor::anonymous_namespace{pixel_index_command.cc}::PixelIndexAction, yaze::editor::ScreenEditAction, yaze::editor::GraphicsScratchView::LibraryEdit, yaze::editor::MessageEditAction, yaze::editor::MusicSongEditAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::TerrainStrokeAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::AuthoringAction, yaze::editor::anonymous_namespace{overworld_editor.cc}::LyraTerrainPaintAction, yaze::editor::OverworldTilePaintAction, yaze::editor::OverworldRecordEditAction< Record >, yaze::editor::OverworldItemsEditAction, yaze::editor::OverworldMapPropertyEditAction, yaze::editor::OverworldMapPropertyBatchEditAction, yaze::editor::OverworldProjectLabelEditAction, yaze::editor::anonymous_namespace{project_graphics_import_command.cc}::ProjectGraphicsImportAction, yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction, yaze::editor::Tile16EditAction, yaze::editor::anonymous_namespace{scratch_space.cc}::ScratchWorkspaceUndoAction, and yaze::editor::SpriteEditAction.
|
inlinevirtual |
Approximate memory footprint for budget enforcement.
Reimplemented in yaze::editor::anonymous_namespace{dungeon_editor_v2_chest_edits.cc}::ChestContentsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >, yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntranceCameraRepairAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart.cc}::RailObjectsAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_minecart_nodes.cc}::MinecartNodeAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_edits.cc}::RoomMetadataAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_room_transfer.cc}::RoomTransferAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_selection_edits.cc}::DungeonSelectionAction, yaze::editor::anonymous_namespace{dungeon_editor_v2_undo.cc}::RoomGraphicsSheetAction, yaze::editor::DungeonObjectsAction, yaze::editor::DungeonEntitiesAction, yaze::editor::DungeonCustomCollisionAction, yaze::editor::DungeonCustomCollisionBatchAction, yaze::editor::DungeonWaterFillAction, yaze::editor::anonymous_namespace{gfx_group_editor_main.cc}::GraphicsSheetAssignmentAction, yaze::editor::GraphicsPixelEditAction, yaze::editor::anonymous_namespace{palette_pixel_command.cc}::PalettePixelAction, yaze::editor::anonymous_namespace{pixel_index_command.cc}::PixelIndexAction, yaze::editor::ScreenEditAction, yaze::editor::GraphicsScratchView::LibraryEdit, yaze::editor::MessageEditAction, yaze::editor::MusicSongEditAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::TerrainStrokeAction, yaze::editor::anonymous_namespace{lyra_terrain_canvas.cc}::AuthoringAction, yaze::editor::anonymous_namespace{overworld_editor.cc}::LyraTerrainPaintAction, yaze::editor::OverworldTilePaintAction, yaze::editor::OverworldRecordEditAction< Record >, yaze::editor::OverworldItemsEditAction, yaze::editor::OverworldMapPropertyEditAction, yaze::editor::OverworldMapPropertyBatchEditAction, yaze::editor::OverworldProjectLabelEditAction, yaze::editor::anonymous_namespace{project_graphics_import_command.cc}::ProjectGraphicsImportAction, yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction, yaze::editor::Tile16EditAction, yaze::editor::anonymous_namespace{scratch_space.cc}::ScratchWorkspaceUndoAction, and yaze::editor::SpriteEditAction.
Definition at line 31 of file undo_action.h.
|
inlinevirtual |
Whether this action can merge with the previous action on the stack. Called only when both actions have the same concrete type.
Reimplemented in yaze::editor::DungeonObjectsAction, yaze::editor::DungeonEntitiesAction, yaze::editor::DungeonCustomCollisionAction, yaze::editor::DungeonCustomCollisionBatchAction, yaze::editor::DungeonWaterFillAction, yaze::editor::GraphicsPixelEditAction, yaze::editor::ScreenEditAction, yaze::editor::OverworldItemsEditAction, yaze::editor::OverworldMapPropertyEditAction, yaze::editor::OverworldMapPropertyBatchEditAction, yaze::editor::OverworldProjectLabelEditAction, yaze::editor::Tile16EditAction, yaze::editor::SpriteEditAction, yaze::editor::OverworldTilePaintAction, yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction, and yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >.
Definition at line 35 of file undo_action.h.
|
inlinevirtual |
Absorb the previous action into this one. Precondition: CanMergeWith(prev) returned true.
Reimplemented in yaze::editor::OverworldTilePaintAction, yaze::editor::anonymous_namespace{tile16_edit_history.cc}::Tile16DefinitionEditAction, and yaze::editor::anonymous_namespace{dungeon_editor_v2_entrance_camera.cc}::DungeonEntrancePropertiesAction< Record >.
Definition at line 39 of file undo_action.h.