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

#include <overworld_undo_actions.h>

Inheritance diagram for yaze::editor::OverworldMapPropertyEditAction:
Collaboration diagram for yaze::editor::OverworldMapPropertyEditAction:

Public Types

using ApplyFn = std::function<absl::Status(const OverworldPropertyEdit&)>
 

Public Member Functions

 OverworldMapPropertyEditAction (OverworldPropertyEdit before, OverworldPropertyEdit after, ApplyFn apply, 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

OverworldPropertyEdit before_
 
OverworldPropertyEdit after_
 
ApplyFn apply_
 
std::string description_
 

Detailed Description

Definition at line 231 of file overworld_undo_actions.h.

Member Typedef Documentation

◆ ApplyFn

Definition at line 233 of file overworld_undo_actions.h.

Constructor & Destructor Documentation

◆ OverworldMapPropertyEditAction()

yaze::editor::OverworldMapPropertyEditAction::OverworldMapPropertyEditAction ( OverworldPropertyEdit before,
OverworldPropertyEdit after,
ApplyFn apply,
std::string description )
inline

Definition at line 235 of file overworld_undo_actions.h.

Member Function Documentation

◆ Undo()

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

Implements yaze::editor::UndoAction.

Definition at line 243 of file overworld_undo_actions.h.

References apply_, and before_.

◆ Redo()

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

Implements yaze::editor::UndoAction.

Definition at line 251 of file overworld_undo_actions.h.

References after_, and apply_.

◆ Description()

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

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

Implements yaze::editor::UndoAction.

Definition at line 259 of file overworld_undo_actions.h.

References description_.

◆ MemoryUsage()

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

Approximate memory footprint for budget enforcement.

Reimplemented from yaze::editor::UndoAction.

Definition at line 261 of file overworld_undo_actions.h.

References after_, before_, yaze::editor::OverworldPropertyEdit::description, and description_.

◆ CanMergeWith()

bool yaze::editor::OverworldMapPropertyEditAction::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 266 of file overworld_undo_actions.h.

Member Data Documentation

◆ before_

OverworldPropertyEdit yaze::editor::OverworldMapPropertyEditAction::before_
private

Definition at line 269 of file overworld_undo_actions.h.

Referenced by MemoryUsage(), and Undo().

◆ after_

OverworldPropertyEdit yaze::editor::OverworldMapPropertyEditAction::after_
private

Definition at line 270 of file overworld_undo_actions.h.

Referenced by MemoryUsage(), and Redo().

◆ apply_

ApplyFn yaze::editor::OverworldMapPropertyEditAction::apply_
private

Definition at line 271 of file overworld_undo_actions.h.

Referenced by Redo(), and Undo().

◆ description_

std::string yaze::editor::OverworldMapPropertyEditAction::description_
private

Definition at line 272 of file overworld_undo_actions.h.

Referenced by Description(), and MemoryUsage().


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