示例#1
0
文件: caretaker.cs 项目: Akio532/lab4
        public GameMemento Restore()
        {
            if (states.Count == 0)
            {
                throw new ArgumentNullException();
            }
            GameMemento state = states.Pop();

            return(state);
        }
示例#2
0
文件: caretaker.cs 项目: Akio532/lab4
 public void Save(GameMemento state)
 {
     states.Push(state);
 }