package view; import java.util.Date; public class User { private String password; private String userID; private Date lastLogin; private String name; private int currentScore, maxScore; public User() { lastLogin = new Date(); maxScore = Integer.MIN_VALUE; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUserID() { return userID; } public void setUserID(String userID) { this.userID = userID; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getLastLogin() { return lastLogin; } public void setLastLogin(Date lastLogin) { this.lastLogin = lastLogin; } public int getCurrentScore() { return currentScore; } public void setCurrentScore(int currentScore) { this.currentScore += currentScore; if (this.currentScore > maxScore) { setMaxScore(this.currentScore); } } public int getMaxScore() { return maxScore; } public void setMaxScore(int maxScore) { this.maxScore = maxScore; } public String toString() { String result = "name = " + name; result = result + ": last session = " + lastLogin; result = result + " current score = " + currentScore; result = result + " max score = " + maxScore; return result; } }