forked from IF-LK-2020/wordle
Viel hinzugefügt
-Datenbank-Tabellen hinzugefügt (zum letzten Wordle-game und won_on_turn_n Tabelle) -Ifception fortgesetzt, das geben eines guesses funktioniert nun -give guess gefixt
This commit is contained in:
209
User.java
209
User.java
@@ -1,123 +1,138 @@
|
||||
import java.time.LocalDate;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
public class User {
|
||||
private String connectionID;
|
||||
private String username;
|
||||
private String password;
|
||||
private int timesPlayed;
|
||||
private int winPercentage;
|
||||
private int currentStreak;
|
||||
private int maxStreak;
|
||||
private int lastDayWOTDFinished;
|
||||
private int state;
|
||||
private int wins;
|
||||
private int [] wonInTurn;
|
||||
private Game game;
|
||||
private String connectionID;
|
||||
private String username;
|
||||
private String password;
|
||||
private int timesPlayed;
|
||||
private int winPercentage;
|
||||
private int currentStreak;
|
||||
private int maxStreak;
|
||||
private int lastDayWOTDPlayed;
|
||||
private int state;
|
||||
private int wins;
|
||||
private int[] wonInTurn;
|
||||
private Game game;
|
||||
|
||||
public User (String pConnectionID){
|
||||
connectionID = pConnectionID;
|
||||
game = new Game();
|
||||
}
|
||||
|
||||
public Game getGame(){
|
||||
return game;
|
||||
}
|
||||
|
||||
public String getConnectionID() {
|
||||
return connectionID;
|
||||
}
|
||||
public User(String pConnectionID) {
|
||||
connectionID = pConnectionID;
|
||||
game = new Game();
|
||||
}
|
||||
|
||||
public int getCurrentStreak() {
|
||||
return currentStreak;
|
||||
}
|
||||
public Game getGame() {
|
||||
return game;
|
||||
}
|
||||
|
||||
public int getLastDayWOTDFinished() {
|
||||
return lastDayWOTDFinished;
|
||||
}
|
||||
public String getConnectionID() {
|
||||
return connectionID;
|
||||
}
|
||||
|
||||
public int getMaxStreak() {
|
||||
return maxStreak;
|
||||
}
|
||||
public int getCurrentStreak() {
|
||||
return currentStreak;
|
||||
}
|
||||
|
||||
public int getTimesPlayed() {
|
||||
return timesPlayed;
|
||||
}
|
||||
public int getLastDayWOTDPlayed() {
|
||||
return lastDayWOTDPlayed;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
public int getMaxStreak() {
|
||||
return maxStreak;
|
||||
}
|
||||
|
||||
public void setWins(int wins) {
|
||||
this.wins = wins;
|
||||
}
|
||||
public int getTimesPlayed() {
|
||||
return timesPlayed;
|
||||
}
|
||||
|
||||
public int getWinPercentage() {
|
||||
return winPercentage;
|
||||
}
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public int getWonInTurnIndex(int index) {
|
||||
return wonInTurn[index];
|
||||
}
|
||||
public void setWins(int wins) {
|
||||
this.wins = wins;
|
||||
}
|
||||
|
||||
public int[] getWonInTurn() {
|
||||
return wonInTurn;
|
||||
}
|
||||
public int getWinPercentage() {
|
||||
return winPercentage;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
public int getWonInTurnIndex(int index) {
|
||||
return wonInTurn[index];
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public int[] getWonInTurn() {
|
||||
return wonInTurn;
|
||||
}
|
||||
|
||||
public int getWins() {
|
||||
return wins;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setConnectionID(String connectionID) {
|
||||
this.connectionID = connectionID;
|
||||
}
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setCurrentStreak(int currentStreak) {
|
||||
this.currentStreak = currentStreak;
|
||||
}
|
||||
public int getWins() {
|
||||
return wins;
|
||||
}
|
||||
|
||||
public void setLastDayWOTDFinished(int lastDayWOTDFinished) {
|
||||
this.lastDayWOTDFinished = lastDayWOTDFinished;
|
||||
}
|
||||
public void setConnectionID(String connectionID) {
|
||||
this.connectionID = connectionID;
|
||||
}
|
||||
|
||||
public void setMaxStreak(int maxStreak) {
|
||||
this.maxStreak = maxStreak;
|
||||
}
|
||||
public void setCurrentStreak(int currentStreak) {
|
||||
this.currentStreak = currentStreak;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
public void updateLastDayWOTDPlayed() {
|
||||
lastDayWOTDPlayed = (int) ChronoUnit.DAYS.between(LocalDate.ofEpochDay(0), LocalDate.now());
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
public void setMaxStreak(int maxStreak) {
|
||||
this.maxStreak = maxStreak;
|
||||
}
|
||||
|
||||
public void setTimesPlayed(int timesPlayed) {
|
||||
this.timesPlayed = timesPlayed;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void setWinPercentage(int winPercentage) {
|
||||
this.winPercentage = winPercentage;
|
||||
}
|
||||
public void setTimesPlayed(int timesPlayed) {
|
||||
this.timesPlayed = timesPlayed;
|
||||
}
|
||||
|
||||
public void setWonInTurnIndex(int index, int content) {
|
||||
this.wonInTurn[index] = content;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public void setWonInTurn(int[] wonInTurn) {
|
||||
this.wonInTurn = wonInTurn;
|
||||
}
|
||||
|
||||
public boolean loggedIn() {
|
||||
return password != null && username != null;
|
||||
}
|
||||
public void setWinPercentage(int winPercentage) {
|
||||
this.winPercentage = winPercentage;
|
||||
}
|
||||
|
||||
public void setWonInTurnIndex(int index, int content) {
|
||||
this.wonInTurn[index] = content;
|
||||
}
|
||||
|
||||
public void setWonInTurn(int[] wonInTurn) {
|
||||
this.wonInTurn = wonInTurn;
|
||||
}
|
||||
|
||||
public boolean loggedIn() {
|
||||
return password != null && username != null;
|
||||
}
|
||||
|
||||
public String[] getLastGuesses() {
|
||||
return game.getGuesses();
|
||||
}
|
||||
|
||||
public void setLastGuesses(String[] guesses) {
|
||||
game.setGuesses(guesses);
|
||||
}
|
||||
|
||||
public void setLastDayWOTDPlayed(int time) {
|
||||
lastDayWOTDPlayed = time;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user