Editor API
UnigineEditor public API
Editor::Action Class Referenceabstract

This basic class is used to represent any possible user action. More...

#include <Undo.h>

Inheritance diagram for Editor::Action:
Editor::CreateNodesAction Editor::EnableNodeAction Editor::RemoveNodesAction Editor::RenameNodeAction Editor::ReparentNodesAction Editor::SelectionAction Editor::SetNodeTransformAction

Public Member Functions

virtual void apply ()=0
 Applies the action. More...
 
virtual void undo ()=0
 Reverts the action. More...
 
virtual void redo ()=0
 Redoes the previously undone action (reverses the undo method). More...
 
virtual bool validate ()
 This method allows action to do some internal cleanup. Return value indicates whether the action is still sane. Whenever it returns false asset system will delete invalid action for good. More...
 
virtual bool modifiesWorld () const
 Indicates whether the action brings any changes to the scene. Actions like selection, for example, change nothing and shouldn't set world‘s "dirty state". For such actions this method would return 'false’. More...
 

Detailed Description

This basic class is used to represent any possible user action.

Member Function Documentation

◆ apply()

◆ modifiesWorld()

virtual bool Editor::Action::modifiesWorld ( ) const
inlinevirtual

Indicates whether the action brings any changes to the scene. Actions like selection, for example, change nothing and shouldn't set world‘s "dirty state". For such actions this method would return 'false’.

Reimplemented in Editor::SelectionAction.

◆ redo()

virtual void Editor::Action::redo ( )
pure virtual

◆ undo()

◆ validate()

virtual bool Editor::Action::validate ( )
inlinevirtual

This method allows action to do some internal cleanup. Return value indicates whether the action is still sane. Whenever it returns false asset system will delete invalid action for good.

Reimplemented in Editor::EnableNodeAction, Editor::RenameNodeAction, Editor::SetNodeTransformAction, Editor::RemoveNodesAction, and Editor::SelectionAction.