예제 #1
0
        public PlayerMemento Restore()
        {
            int           index   = Size() - 1;
            PlayerMemento memento = states[index];

            states.RemoveAt(index);
            return(memento);
        }
예제 #2
0
 public void RestoreState(PlayerMemento memento)
 {
     _player.Money += memento.GetPrice();
     _player.Towers = memento.GetTowers();
 }
예제 #3
0
 public void Add(PlayerMemento memento)
 {
     states.Add(memento);
 }