Fehler gefixt

Hat mir die Nacht gekostet
This commit is contained in:
2022-03-26 00:34:14 +01:00
parent 1a966b285f
commit 6eb5f59b50
4 changed files with 114 additions and 49 deletions

View File

@@ -74,16 +74,31 @@ public class User {
public void setCurrentStreak(int currentStreak) {
this.currentStreak = currentStreak;
}
public void updateLastDayWOTDPlayed() {
lastDayWOTDPlayed = (int) ChronoUnit.DAYS.between(LocalDate.ofEpochDay(0), LocalDate.now());
if (maxStreak < currentStreak) {
maxStreak = currentStreak;
}
}
public void setMaxStreak(int maxStreak) {
this.maxStreak = maxStreak;
}
private int getTotalWins() {
int w = 0;
for (int i = 0; i < wonInTurn.length; i++) {
w += wonInTurn[i];
}
return w;
}
public void updateWinPercentage() {
winPercentage = (int) (getTotalWins() / timesPlayed) * 100;
}
public void updateLastDayWOTDPlayed() {
lastDayWOTDPlayed = (int) ChronoUnit.DAYS.between(LocalDate.ofEpochDay(0), LocalDate.now());
}
public void setPassword(String password) {
this.password = password;
}