1#ifndef YAZE_APP_EDITOR_GRAPHICS_SCREEN_UNDO_ACTIONS_H_
2#define YAZE_APP_EDITOR_GRAPHICS_SCREEN_UNDO_ACTIONS_H_
12#include "absl/status/status.h"
38 std::vector<std::array<std::string, zelda3::kNumRooms>>
labels;
77 RestoreFn restore, std::string description)
83 absl::Status
Undo()
override {
85 return absl::InternalError(
"ScreenEditAction: no restore callback");
88 return absl::OkStatus();
91 absl::Status
Redo()
override {
93 return absl::InternalError(
"ScreenEditAction: no restore callback");
96 return absl::OkStatus();
105 size += floor.size();
107 size += floor.size();
109 size += floor.size();
111 size += floor.size();
Undoable action for screen editor edits.
std::function< void(const ScreenSnapshot &)> RestoreFn
std::string Description() const override
Human-readable description (e.g., "Paint 12 tiles on map 5")
ScreenEditAction(ScreenSnapshot before, ScreenSnapshot after, RestoreFn restore, std::string description)
absl::Status Redo() override
bool CanMergeWith(const UndoAction &) const override
size_t MemoryUsage() const override
Approximate memory footprint for budget enforcement.
absl::Status Undo() override
Abstract base for all undoable actions (Command pattern)
ScreenEditType
Which screen type the snapshot belongs to.
Snapshot of dungeon map editing state for undo/redo.
zelda3::DungeonMap map_data
std::vector< std::array< std::string, zelda3::kNumRooms > > labels
Unified screen editor snapshot.
DungeonMapSnapshot dungeon_map
Tile16CompSnapshot tile16_comp
Snapshot of tile16 composition state for undo/redo.
std::array< gfx::TileInfo, 4 > tile_info
DungeonMap represents the map menu for a dungeon.
std::vector< std::array< uint8_t, kNumRooms > > floor_rooms
std::vector< std::array< uint8_t, kNumRooms > > floor_gfx