public void Undo(MyObj obj) { ObjectMemento lastMemo = careTake.GetLast(); if (lastMemo != null) { obj.ObjState = lastMemo.getObj().ObjState; } }
public ObjectMemento(MyObj currObj) { this.myObj = currObj; }
public void Save(MyObj obj) { careTake.AddMemento(new ObjectMemento(obj)); }