public Momento GetMomento() { Momento m = new Momento(); m.SetState(CurrentPlayingIndex, CurrentPlayingSongLocation); return(m); }
public static void Run() { SongList sl = new SongList(); sl.IncreasePlayingIndex(); sl.IncreasePlayingIndex(); sl.IncreasePlayingLocation(); CareTaker c = new CareTaker(sl); Momento m = c.CreateMomento(); sl.IncreasePlayingIndex(); c.SetMomento(m); Console.WriteLine(sl.ReadPlayingIndex()); }
public void SetMomento(Momento m) { this.CurrentPlayingIndex = m.SongIndex; this.CurrentPlayingSongLocation = m.SongLocation; }
public void SetMomento(Momento m) { this.song.SetMomento(m); }