示例#1
0
 public static void SaveState(Originator <T> originator)
 {
     _mementos.Add(originator.CreateMemento());
 }
示例#2
0
        public static void RestoreState(Originator <T> orig, int stateNumber)
        {
            Memento <T> memento = _mementos[stateNumber];

            orig.SetMemento(memento);
        }