| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsEditorPrerequisites.h"
- #include "BsEditorCommand.h"
- #include "BsUndoRedo.h"
- namespace bs
- {
- /** @addtogroup UndoRedo
- * @{
- */
- /** A command used for undo/redo purposes. Creates a scene object and removes it as an undo operation. */
- class BS_ED_EXPORT CmdCreateSO : public EditorCommand
- {
- public:
- ~CmdCreateSO();
- /**
- * Creates a new scene object. Automatically registers the command with undo/redo system.
- *
- * @param[in] name Name of the scene object.
- * @param[in] flags Optional creation flags for the scene object.
- * @param[in] description Optional description of what exactly the command does.
- * @return Newly created scene object.
- */
- static HSceneObject execute(const String& name, UINT32 flags, const WString& description = StringUtil::WBLANK);
- /** @copydoc EditorCommand::commit */
- void commit() override;
- /** @copydoc EditorCommand::revert */
- void revert() override;
- private:
- friend class UndoRedo;
- CmdCreateSO(const WString& description, const String& name, UINT32 flags);
- String mName;
- UINT32 mFlags;
- HSceneObject mSceneObject;
- };
- /** @} */
- }
|