Files
Studio/Assets/Scripts/Studio/Command/ActionCommand.cs

38 lines
926 B
C#

using Studio.Command;
namespace Studio.Manage
{
public class ActionCommand : IReversibleCommand
{
private readonly System.Action _executeAction;
private readonly System.Action _undoAction;
public ActionCommand(System.Action executeAction, System.Action undoAction)
{
_executeAction = executeAction;
_undoAction = undoAction;
}
public string id { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public bool CanExecute()
{
throw new System.NotImplementedException();
}
public void Execute()
{
_executeAction?.Invoke();
}
public void Redo()
{
throw new System.NotImplementedException();
}
public void Undo()
{
_undoAction?.Invoke();
}
}
}