forked from IF-LK-2020/wordle
Fehler gefixt
Hat mir die Nacht gekostet
This commit is contained in:
23
User.java
23
User.java
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user