Bugfix/everything
# Conflicts: # model/SongHandler.java # model/gameState/PlayState.java
This commit is contained in:
+6
-1
@@ -12,7 +12,7 @@ import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
|
||||
public class Song {
|
||||
public class Song implements Comparable<Song>{
|
||||
|
||||
private String title;
|
||||
private String subtitle;
|
||||
@@ -150,4 +150,9 @@ public class Song {
|
||||
public void close()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Song s) {
|
||||
return getTitle().compareTo(s.getTitle());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class SongInstance {
|
||||
|
||||
for(ButtonInstance i : buttons)
|
||||
{
|
||||
if(i.getTime() >= progress)
|
||||
if(i.getTime() > progress)
|
||||
{
|
||||
return b;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package audio.sorting;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import audio.Song;
|
||||
|
||||
public class SortALPHA implements Comparator<Song> {
|
||||
|
||||
@Override
|
||||
public int compare(Song s1, Song s2) {
|
||||
return s1.getTitle().compareTo(s2.getTitle());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package audio.sorting;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import audio.Song;
|
||||
|
||||
public class SortPLAYED implements Comparator<Song> {
|
||||
|
||||
@Override
|
||||
public int compare(Song s1, Song s2) {
|
||||
return s1.getAuthor().compareTo(s2.getAuthor());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user