| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsEditorPrerequisites.h"
- namespace bs
- {
- /** @addtogroup UndoRedo
- * @{
- */
- /**
- * A command used for undo/redo purposes. It records a change occurring on some object and allows you to apply or
- * revert that change as needed.
- */
- class BS_ED_EXPORT EditorCommand
- {
- public:
- EditorCommand(const String& description);
- virtual ~EditorCommand() { }
- /** Applies the command, committing the change. */
- virtual void commit() { }
- /** Reverts the command, reverting the change previously done with commit(). */
- virtual void revert() { }
- private:
- friend class UndoRedo;
- /** Triggers when a command is added to an undo/redo stack. */
- virtual void onCommandAdded() { }
- /** Triggers when a command is removed from an undo/redo stack. */
- virtual void onCommandRemoved() {}
- String mDescription;
- UINT32 mId;
- };
- /** @} */
- }
|