Explorar o código

Added mostplayed counter

Kenneth van Ewijk %!s(int64=10) %!d(string=hai) anos
pai
achega
3f22402bc4
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      audio/Song.java

+ 10 - 0
audio/Song.java

@@ -155,4 +155,14 @@ public class Song implements Comparable<Song>{
 	public int compareTo(Song s) {
 		return getTitle().compareTo(s.getTitle());
 	}
+	
+	public int getTimesPlayed()
+	{
+		int timesPlayed = 0;
+		for(SongInstance s : songs)
+		{
+			timesPlayed += s.getTimesPlayed();
+		}
+		return timesPlayed;
+	}
 }