public PlayerMemento Restore() { int index = Size() - 1; PlayerMemento memento = states[index]; states.RemoveAt(index); return(memento); }
public void RestoreState(PlayerMemento memento) { _player.Money += memento.GetPrice(); _player.Towers = memento.GetTowers(); }
public void Add(PlayerMemento memento) { states.Add(memento); }