Esempio n. 1
0
        public Momento GetMomento()
        {
            Momento m = new Momento();

            m.SetState(CurrentPlayingIndex, CurrentPlayingSongLocation);
            return(m);
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
 public void SetMomento(Momento m)
 {
     this.CurrentPlayingIndex        = m.SongIndex;
     this.CurrentPlayingSongLocation = m.SongLocation;
 }
Esempio n. 4
0
 public void SetMomento(Momento m)
 {
     this.song.SetMomento(m);
 }