/// <summary> /// 保存一个备忘录 /// </summary> /// <param name="memento"></param> public void SaveMemento(Memento memento) { this.memento = memento; }
/// <summary> /// 恢复当前状态为备忘录所保存的状态 /// </summary> /// <param name="memento"></param> public void RestoreMemento(Memento memento) { this.state = memento.GetState(); }