| 1234567891011121314151617181920212223242526272829303132 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- using System;
- using System.Runtime.CompilerServices;
- using bs;
- namespace bs.Editor
- {
- /// <summary>
- /// Base class for implementation of commands that can be recorded in the UndoRedo system.
- /// </summary>
- public abstract class UndoableCommand : ScriptObject
- {
- public UndoableCommand()
- {
- Internal_CreateInstance(this);
- }
- /// <summary>
- /// Applies the command, committing the change.
- /// </summary>
- protected abstract void Commit();
- /// <summary>
- /// Reverts the command, reverting the change previously done with <see cref="Commit"/>.
- /// </summary>
- protected abstract void Revert();
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_CreateInstance(UndoableCommand instance);
- }
- }
|