BsEditorCommand.h 666 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. namespace BansheeEngine
  4. {
  5. /**
  6. * @brief A command used for undo/redo purposes. It records a change occurring on
  7. * some object and allows you to apply or revert that change as needed.
  8. */
  9. class EditorCommand
  10. {
  11. public:
  12. virtual ~EditorCommand() { }
  13. /**
  14. * @brief Applies the command, commiting the change.
  15. */
  16. virtual void commit() { }
  17. /**
  18. * @brief Reverts the command, reverting the change previously
  19. * done with "commit".
  20. */
  21. virtual void revert() { }
  22. /**
  23. * @brief Deletes the command.
  24. */
  25. static void destroy(EditorCommand* command);
  26. };
  27. }