Durchschnitszeit-Funktion verbessert

Improvements_Vick
Simona-Ioana Purdila 2025-01-06 20:09:07 +01:00
parent d88e35b4e2
commit ffbd2dab10
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,7 @@
Ioana,25,Hitori4x4_leicht.csv,0
test,22,Hitori4x4_leicht.csv,0
Test2,72,Hitori5x5_leicht.csv,0
Test3,100,Hitori8x8_medium.csv,0
Test3,100,Hitori8x8_medium.csv,0
Test4,200,Hitori15x15_medium.csv,10
IOANA VERSUCH 156,105,Hitori5x5_leicht.csv,0
IOANA VERSUCH 439,44,Hitori5x5_leicht.csv,0

View File

@ -71,13 +71,14 @@ public class HighscoreDialog extends JDialog {
int rank = 1;
for (HighscoreManager.Highscore highscore : highscores) {
String bName = highscore.getBoardName().replaceAll("\\.csv$", ""); // .csv entfernen
double averageTime = averageTimes.getOrDefault(highscore.getBoardName(), 0.0);
tableModel.addRow(new Object[]{
rank++, // Platzierung
highscore.getPlayerName(), // Name
highscore.getScore(), // Punkte
highscore.getErrors(), //Errors
highscore.getBoardName(), // Spielfeld
bName, // Spielfeld
String.format("%.2f", averageTime) // Durchschnittszeit
});
}