diff options
| author | ilotterytea <iltsu@alright.party> | 2024-06-01 00:51:20 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-06-01 00:51:20 +0500 |
| commit | e49f8b310d6032c99406baf04b5ec3eba0fd111f (patch) | |
| tree | 5120a1fbbf923da5ee8bc8561ed1545855aa5547 /core/src/com/ilotterytea/maxoning/audio | |
| parent | 10e9df6190ddc3f9c8dd7c86482449bec4651e0c (diff) | |
upd: moved the whole project under kz.ilotterytea.maxon name
Diffstat (limited to 'core/src/com/ilotterytea/maxoning/audio')
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/audio/Playlist.kt | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/core/src/com/ilotterytea/maxoning/audio/Playlist.kt b/core/src/com/ilotterytea/maxoning/audio/Playlist.kt deleted file mode 100644 index 32788e6..0000000 --- a/core/src/com/ilotterytea/maxoning/audio/Playlist.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.ilotterytea.maxoning.audio - -import com.badlogic.gdx.audio.Music -import com.ilotterytea.maxoning.utils.math.Math - -/** - * Playlist. - */ -class Playlist(vararg musics: Music) { - private val playlist: Array<out Music> = musics - var playingNow: Music = playlist[0] - private var index = 0; - - var shuffleMode = false - - /** - * Play next music. - */ - fun next() { - if (playingNow.isPlaying) playingNow.stop() - - if (shuffleMode) { - index = Math.getRandomNumber(0, playlist.size - 1) - playingNow = playlist[index] - playingNow.play() - } else { - index++ - if (index > playlist.size - 1) index = 0 - - playingNow = playlist[index] - playingNow.play() - } - } -}
\ No newline at end of file |
