mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
Added shuffling on user request
This commit is contained in:
@@ -18,10 +18,13 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
|
||||
private int playingIndex = 0;
|
||||
private boolean playing = false;
|
||||
|
||||
public MusicManager(List<T> resources) {
|
||||
public MusicManager(List<T> resources, boolean shuffleMusic) {
|
||||
this.dispatcher = new JavaFXDispatcher();
|
||||
this.resources = resources;
|
||||
createShuffled();
|
||||
// Shuffle if wanting to shuffle
|
||||
if (shuffleMusic) createShuffled();
|
||||
else backgroundMusic.addAll(resources);
|
||||
// ------------------------------
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user