parent
e2a78a84e7
commit
e114a7aa93
@ -0,0 +1,3 @@
|
||||
11 1 20-01-22
|
||||
12 1 20-01-22
|
||||
17 1 20-01-22
|
@ -0,0 +1,14 @@
|
||||
package model;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ListeScore {
|
||||
private ArrayList listeScore = new ArrayList<Score>();
|
||||
|
||||
public ListeScore() {
|
||||
}
|
||||
public void addScore(Score score) {
|
||||
listeScore.add(score);
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package model;
|
||||
|
||||
import model.ListeScore;
|
||||
import model.Score;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class ResultatTxt {
|
||||
|
||||
public void sauvegarderResultat(int resultat, int lvl) {
|
||||
try {
|
||||
LocalDate today = LocalDate.now();
|
||||
FileWriter fw = new FileWriter("resultats.txt",true);
|
||||
fw.write(resultat + " " + lvl + " " + today.format(DateTimeFormatter.ofPattern("dd-MM-yy")) + "\n");
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package model;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class Score {
|
||||
private int score;
|
||||
private int level;
|
||||
private String date;
|
||||
|
||||
public Score(int score, int level,String date) {
|
||||
this.score = score;
|
||||
this.level = level;
|
||||
this.date = date;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue