2
0

BsCmdCreateSO.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsEditorCommand.h"
  6. #include "BsUndoRedo.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup UndoRedo
  10. * @{
  11. */
  12. /** A command used for undo/redo purposes. Creates a scene object and removes it as an undo operation. */
  13. class BS_ED_EXPORT CmdCreateSO : public EditorCommand
  14. {
  15. public:
  16. ~CmdCreateSO();
  17. /**
  18. * Creates a new scene object. Automatically registers the command with undo/redo system.
  19. *
  20. * @param[in] name Name of the scene object.
  21. * @param[in] flags Optional creation flags for the scene object.
  22. * @param[in] description Optional description of what exactly the command does.
  23. * @return Newly created scene object.
  24. */
  25. static HSceneObject execute(const String& name, UINT32 flags, const WString& description = StringUtil::WBLANK);
  26. /** @copydoc EditorCommand::commit */
  27. void commit() override;
  28. /** @copydoc EditorCommand::revert */
  29. void revert() override;
  30. private:
  31. friend class UndoRedo;
  32. CmdCreateSO(const WString& description, const String& name, UINT32 flags);
  33. String mName;
  34. UINT32 mFlags;
  35. HSceneObject mSceneObject;
  36. };
  37. /** @} */
  38. }