ezEngine  Release 25.03
ezCommand Class Referenceabstract

Interface for a command. More...

#include <Command.h>

Inheritance diagram for ezCommand:

Public Types

enum  CommandState { WasDone, WasUndone }
 

Public Member Functions

bool IsUndoable () const
 
bool HasChildActions () const
 
bool HasModifiedDocument () const
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Protected Member Functions

ezStatus Do (bool bRedo)
 
ezStatus Undo (bool bFireEvents)
 
void Cleanup (CommandState state)
 
ezStatus AddSubCommand (ezCommand &command)
 
ezDocumentGetDocument ()
 

Protected Attributes

ezString m_sDescription
 
bool m_bUndoable = true
 
bool m_bModifiedDocument = true
 
ezHybridArray< ezCommand *, 8 > m_ChildActions
 
ezDocumentm_pDocument = nullptr
 

Friends

class ezCommandHistory
 
class ezCommandTransaction
 

Additional Inherited Members

- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 

Detailed Description

Interface for a command.

Commands are the only objects that have non-const access to any data structures (contexts, documents etc.). Thus, any modification must go through a command and the ezCommandHistory is the only class capable of executing commands.


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