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

#include <overworld_undo_actions.h>

Inheritance diagram for yaze::editor::OverworldMapPropertyBatchEditAction:
Collaboration diagram for yaze::editor::OverworldMapPropertyBatchEditAction:

Public Types

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

Public Member Functions

 OverworldMapPropertyBatchEditAction (std::vector< OverworldPropertyEdit > before, std::vector< 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

std::vector< OverworldPropertyEditbefore_
 
std::vector< OverworldPropertyEditafter_
 
ApplyFn apply_
 
std::string description_
 

Detailed Description

Definition at line 275 of file overworld_undo_actions.h.

Member Typedef Documentation

◆ ApplyFn

Definition at line 277 of file overworld_undo_actions.h.

Constructor & Destructor Documentation

◆ OverworldMapPropertyBatchEditAction()

yaze::editor::OverworldMapPropertyBatchEditAction::OverworldMapPropertyBatchEditAction ( std::vector< OverworldPropertyEdit > before,
std::vector< OverworldPropertyEdit > after,
ApplyFn apply,
std::string description )
inline

Definition at line 279 of file overworld_undo_actions.h.

Member Function Documentation

◆ Undo()

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

Implements yaze::editor::UndoAction.

Definition at line 287 of file overworld_undo_actions.h.

References apply_, before_, and RETURN_IF_ERROR.

◆ Redo()

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

Implements yaze::editor::UndoAction.

Definition at line 298 of file overworld_undo_actions.h.

References after_, apply_, and RETURN_IF_ERROR.

◆ Description()

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

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

Implements yaze::editor::UndoAction.

Definition at line 309 of file overworld_undo_actions.h.

References description_.

◆ MemoryUsage()

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

Approximate memory footprint for budget enforcement.

Reimplemented from yaze::editor::UndoAction.

Definition at line 311 of file overworld_undo_actions.h.

References after_, before_, and description_.

◆ CanMergeWith()

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

Member Data Documentation

◆ before_

std::vector<OverworldPropertyEdit> yaze::editor::OverworldMapPropertyBatchEditAction::before_
private

Definition at line 325 of file overworld_undo_actions.h.

Referenced by MemoryUsage(), and Undo().

◆ after_

std::vector<OverworldPropertyEdit> yaze::editor::OverworldMapPropertyBatchEditAction::after_
private

Definition at line 326 of file overworld_undo_actions.h.

Referenced by MemoryUsage(), and Redo().

◆ apply_

ApplyFn yaze::editor::OverworldMapPropertyBatchEditAction::apply_
private

Definition at line 327 of file overworld_undo_actions.h.

Referenced by Redo(), and Undo().

◆ description_

std::string yaze::editor::OverworldMapPropertyBatchEditAction::description_
private

Definition at line 328 of file overworld_undo_actions.h.

Referenced by Description(), and MemoryUsage().


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