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