I will need to implement undo/redo to one of my projects. Each action must have a meaningful name to show in the UI.
1- Define an interface IAction
void Execute();
void UnExecute();
bool CanExecute();
bool CanUnExecute();
2- Define an ActionManager
void RecordAction(IAction); //adds an action the the actions vector
void Undo()
void Redo();
bool CanUndo();
bool CanRedo();
No comments:
Post a Comment