예제 #1
0
 public void MakeBackup(IMemento memento)
 {
     Console.WriteLine("-------------Saving state--------------------");
     memento.getGameState().DescribeGame();
     Console.WriteLine("---------------------------------------------");
     mementos.Add(memento);
 }
예제 #2
0
 public void RestoreGame(IMemento memento)
 {
     gameState = memento.getGameState();
     Console.WriteLine("State restored to:");
     gameState.DescribeGame();
 }