Beispiel #1
0
 public static void AddSongToPlaylist(Playlist playlist, PlaylistSong song)
 {
     playlist.songs.Add(song);
     if (playlist.playlistTitle == "Your favorite songs")
     {
         playlist.SavePlaylist();
     }
 }
Beispiel #2
0
 public static void RemoveLevelFromPlaylist(Playlist playlist, string levelId)
 {
     if (playlist.songs.Where(y => y.level != null).Any(x => x.level.levelID == levelId))
     {
         PlaylistSong song = playlist.songs.First(x => x.level != null && x.level.levelID == levelId);
         song.level   = null;
         song.levelId = "";
     }
     if (playlist.playlistTitle == "Your favorite songs")
     {
         playlist.SavePlaylist();
     }
 }