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

#include <dungeon_undo_actions.h>

Inheritance diagram for yaze::editor::DungeonCustomCollisionBatchAction:
Collaboration diagram for yaze::editor::DungeonCustomCollisionBatchAction:

Public Types

using RestoreFn
 

Public Member Functions

 DungeonCustomCollisionBatchAction (std::vector< DungeonCustomCollisionSnapshot > before, std::vector< DungeonCustomCollisionSnapshot > 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

std::vector< DungeonCustomCollisionSnapshotbefore_
 
std::vector< DungeonCustomCollisionSnapshotafter_
 
RestoreFn restore_
 

Detailed Description

Definition at line 146 of file dungeon_undo_actions.h.

Member Typedef Documentation

◆ RestoreFn

Initial value:
std::function<absl::Status(
const std::vector<DungeonCustomCollisionSnapshot>&)>

Definition at line 148 of file dungeon_undo_actions.h.

Constructor & Destructor Documentation

◆ DungeonCustomCollisionBatchAction()

yaze::editor::DungeonCustomCollisionBatchAction::DungeonCustomCollisionBatchAction ( std::vector< DungeonCustomCollisionSnapshot > before,
std::vector< DungeonCustomCollisionSnapshot > after,
RestoreFn restore )
inline

Definition at line 151 of file dungeon_undo_actions.h.

Member Function Documentation

◆ Undo()

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

Implements yaze::editor::UndoAction.

Definition at line 158 of file dungeon_undo_actions.h.

References before_, and restore_.

◆ Redo()

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

Implements yaze::editor::UndoAction.

Definition at line 166 of file dungeon_undo_actions.h.

References after_, and restore_.

◆ Description()

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

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

Implements yaze::editor::UndoAction.

Definition at line 174 of file dungeon_undo_actions.h.

References after_.

◆ MemoryUsage()

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

Approximate memory footprint for budget enforcement.

Reimplemented from yaze::editor::UndoAction.

Definition at line 179 of file dungeon_undo_actions.h.

References after_, and before_.

◆ CanMergeWith()

bool yaze::editor::DungeonCustomCollisionBatchAction::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 184 of file dungeon_undo_actions.h.

Member Data Documentation

◆ before_

std::vector<DungeonCustomCollisionSnapshot> yaze::editor::DungeonCustomCollisionBatchAction::before_
private

Definition at line 187 of file dungeon_undo_actions.h.

Referenced by MemoryUsage(), and Undo().

◆ after_

std::vector<DungeonCustomCollisionSnapshot> yaze::editor::DungeonCustomCollisionBatchAction::after_
private

Definition at line 188 of file dungeon_undo_actions.h.

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

◆ restore_

RestoreFn yaze::editor::DungeonCustomCollisionBatchAction::restore_
private

Definition at line 189 of file dungeon_undo_actions.h.

Referenced by Redo(), and Undo().


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