yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::DungeonWaterFillAction Class Reference

#include <dungeon_undo_actions.h>

Inheritance diagram for yaze::editor::DungeonWaterFillAction:
Collaboration diagram for yaze::editor::DungeonWaterFillAction:

Public Types

using RestoreFn
 

Public Member Functions

 DungeonWaterFillAction (int room_id, WaterFillSnapshot before, WaterFillSnapshot after, 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_
 
WaterFillSnapshot before_
 
WaterFillSnapshot after_
 
RestoreFn restore_
 

Detailed Description

Definition at line 133 of file dungeon_undo_actions.h.

Member Typedef Documentation

◆ RestoreFn

Initial value:
std::function<void(int room_id, const WaterFillSnapshot&)>

Definition at line 135 of file dungeon_undo_actions.h.

Constructor & Destructor Documentation

◆ DungeonWaterFillAction()

yaze::editor::DungeonWaterFillAction::DungeonWaterFillAction ( int room_id,
WaterFillSnapshot before,
WaterFillSnapshot after,
RestoreFn restore )
inline

Definition at line 138 of file dungeon_undo_actions.h.

Member Function Documentation

◆ Undo()

absl::Status yaze::editor::DungeonWaterFillAction::Undo ( )
inlineoverridevirtual

Implements yaze::editor::UndoAction.

Definition at line 145 of file dungeon_undo_actions.h.

References before_, restore_, and room_id_.

◆ Redo()

absl::Status yaze::editor::DungeonWaterFillAction::Redo ( )
inlineoverridevirtual

Implements yaze::editor::UndoAction.

Definition at line 153 of file dungeon_undo_actions.h.

References after_, restore_, and room_id_.

◆ Description()

std::string yaze::editor::DungeonWaterFillAction::Description ( ) const
inlineoverridevirtual

Human-readable description (e.g., "Paint 12 tiles on map 5")

Implements yaze::editor::UndoAction.

Definition at line 161 of file dungeon_undo_actions.h.

References room_id_.

◆ MemoryUsage()

size_t yaze::editor::DungeonWaterFillAction::MemoryUsage ( ) const
inlineoverridevirtual

Approximate memory footprint for budget enforcement.

Reimplemented from yaze::editor::UndoAction.

Definition at line 165 of file dungeon_undo_actions.h.

References after_, before_, and yaze::editor::WaterFillSnapshot::offsets.

◆ CanMergeWith()

bool yaze::editor::DungeonWaterFillAction::CanMergeWith ( const UndoAction & ) const
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 171 of file dungeon_undo_actions.h.

Member Data Documentation

◆ room_id_

int yaze::editor::DungeonWaterFillAction::room_id_
private

Definition at line 174 of file dungeon_undo_actions.h.

Referenced by Description(), Redo(), and Undo().

◆ before_

WaterFillSnapshot yaze::editor::DungeonWaterFillAction::before_
private

Definition at line 175 of file dungeon_undo_actions.h.

Referenced by MemoryUsage(), and Undo().

◆ after_

WaterFillSnapshot yaze::editor::DungeonWaterFillAction::after_
private

Definition at line 176 of file dungeon_undo_actions.h.

Referenced by MemoryUsage(), and Redo().

◆ restore_

RestoreFn yaze::editor::DungeonWaterFillAction::restore_
private

Definition at line 177 of file dungeon_undo_actions.h.

Referenced by Redo(), and Undo().


The documentation for this class was generated from the following file: