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

#include <overworld_undo_actions.h>

Inheritance diagram for yaze::editor::OverworldProjectLabelEditAction:
Collaboration diagram for yaze::editor::OverworldProjectLabelEditAction:

Public Types

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

Public Member Functions

 OverworldProjectLabelEditAction (std::string before, std::string 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

std::string before_
 
std::string after_
 
ApplyFn apply_
 
std::string description_
 

Detailed Description

Definition at line 331 of file overworld_undo_actions.h.

Member Typedef Documentation

◆ ApplyFn

using yaze::editor::OverworldProjectLabelEditAction::ApplyFn = std::function<absl::Status(const std::string&)>

Definition at line 333 of file overworld_undo_actions.h.

Constructor & Destructor Documentation

◆ OverworldProjectLabelEditAction()

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

Definition at line 335 of file overworld_undo_actions.h.

Member Function Documentation

◆ Undo()

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

Implements yaze::editor::UndoAction.

Definition at line 342 of file overworld_undo_actions.h.

References apply_, and before_.

◆ Redo()

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

Implements yaze::editor::UndoAction.

Definition at line 350 of file overworld_undo_actions.h.

References after_, and apply_.

◆ Description()

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

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

Implements yaze::editor::UndoAction.

Definition at line 358 of file overworld_undo_actions.h.

References description_.

◆ MemoryUsage()

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

Approximate memory footprint for budget enforcement.

Reimplemented from yaze::editor::UndoAction.

Definition at line 360 of file overworld_undo_actions.h.

References after_, before_, and description_.

◆ CanMergeWith()

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

Member Data Documentation

◆ before_

std::string yaze::editor::OverworldProjectLabelEditAction::before_
private

Definition at line 367 of file overworld_undo_actions.h.

Referenced by MemoryUsage(), and Undo().

◆ after_

std::string yaze::editor::OverworldProjectLabelEditAction::after_
private

Definition at line 368 of file overworld_undo_actions.h.

Referenced by MemoryUsage(), and Redo().

◆ apply_

ApplyFn yaze::editor::OverworldProjectLabelEditAction::apply_
private

Definition at line 369 of file overworld_undo_actions.h.

Referenced by Redo(), and Undo().

◆ description_

std::string yaze::editor::OverworldProjectLabelEditAction::description_
private

Definition at line 370 of file overworld_undo_actions.h.

Referenced by Description(), and MemoryUsage().


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