DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
DekiEditor::CompoundCommand Class Reference

Several commands undone and redone as one. More...

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/Command.h>

Inherits DekiEditor::Command.

Public Member Functions

 CompoundCommand (const CompoundCommand &)=delete
 CompoundCommand (const std::string &description, std::vector< std::unique_ptr< Command > > commands)
void Execute () override
std::string GetDescription () const override
 Human-readable text shown in the UI, in the editor's current language.
CompoundCommand & operator= (const CompoundCommand &)=delete
void Redo () override
 Calls Execute by default.
bool ReferencesAny (const DeadMemory &dead) const override
 Whether this command holds a raw pointer to anything in dead.
void Undo () override
Public Member Functions inherited from DekiEditor::Command
virtual ~Command ()=default
virtual bool CanMerge (const Command *other) const
 Whether other can be folded into this command.
virtual void Merge (const Command *other)
 Folds other into this command.

Detailed Description

Several commands undone and redone as one.

Constructor & Destructor Documentation

◆ CompoundCommand() [1/2]

DekiEditor::CompoundCommand::CompoundCommand ( const std::string & description,
std::vector< std::unique_ptr< Command > > commands )
inlineexplicit

◆ CompoundCommand() [2/2]

DekiEditor::CompoundCommand::CompoundCommand ( const CompoundCommand & )
delete

Member Function Documentation

◆ Execute()

void DekiEditor::CompoundCommand::Execute ( )
inlineoverridevirtual

Implements DekiEditor::Command.

◆ GetDescription()

std::string DekiEditor::CompoundCommand::GetDescription ( ) const
inlineoverridevirtual

Human-readable text shown in the UI, in the editor's current language.

Implements DekiEditor::Command.

◆ operator=()

CompoundCommand & DekiEditor::CompoundCommand::operator= ( const CompoundCommand & )
delete

◆ Redo()

void DekiEditor::CompoundCommand::Redo ( )
inlineoverridevirtual

Calls Execute by default.

Reimplemented from DekiEditor::Command.

◆ ReferencesAny()

bool DekiEditor::CompoundCommand::ReferencesAny ( const DeadMemory & dead) const
inlineoverridevirtual

Whether this command holds a raw pointer to anything in dead.

CommandHistory asks this when the scene is about to free objects and discards any command that answers true, since Undo()/Redo() on a freed target is a use-after-free.

The default, false, is right for commands that address their target by value or by id. Any command storing a Deki::Object*, Deki::Component* or Scene* MUST override this; see src/core/commands/ for the pattern.

Reimplemented from DekiEditor::Command.

◆ Undo()

void DekiEditor::CompoundCommand::Undo ( )
inlineoverridevirtual

Implements DekiEditor::Command.


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