public static void PlayNextSong() { if (!_canKeepPlaying) { return; } if (MediaPlayer.State == MediaState.Playing) { return; } if (!GameConts.Instance.RandomMusicCycle) { _currentSong++; if (_currentSong > AllSongs.Count - 1) { _currentSong = 0; } } else { _currentSong = _randomNumber.Next(AllSongs.Count); } var key = AllSongs.Keys.ElementAt(_currentSong); _currentPlayingSong = AllSongs[key]; AllSongs[key].Play(); }
public static void Registry(string name, GameSong song) { AllSongs.Add(name, song); }