Re-add the getHistory method.

This commit is contained in:
Me Car 2016-01-31 23:59:45 +09:00
parent 1945e8eaa6
commit a33aa5d2df
4 changed files with 12 additions and 3 deletions

View file

@ -55,7 +55,7 @@ public class SeatView implements Serializable {
this.history = ""; this.history = "";
} else { } else {
this.flagName = seat.getPlayer().getUserData().getFlagName(); this.flagName = seat.getPlayer().getUserData().getFlagName();
this.history = seat.getPlayer().getUserData().getMatchHistory() + " " + seat.getPlayer().getUserData().getTourneyHistory(); this.history = seat.getPlayer().getUserData().getHistory();
} }
} else { } else {
// Empty seat // Empty seat

View file

@ -551,6 +551,11 @@ public class User {
return "<not available>"; return "<not available>";
} }
public static String userStatsToHistory(ResultProtos.UserStatsProto proto) {
return "Matches:" + userStatsToMatchHistory(proto) +
" Tourneys: " + userStatsToTourneyHistory(proto);
}
public static String userStatsToMatchHistory(ResultProtos.UserStatsProto proto) { public static String userStatsToMatchHistory(ResultProtos.UserStatsProto proto) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append(proto.getMatches()); builder.append(proto.getMatches());

View file

@ -205,9 +205,9 @@ public class UserManager {
if (userStats == null) { if (userStats == null) {
return "User " + userName + " not found"; return "User " + userName + " not found";
} }
return "History of user " + userName + ": " + User.userStatsToMatchHistory(userStats.getProto()) + " " + User.userStatsToTourneyHistory(userStats.getProto()); return "History of user " + userName + ": " + User.userStatsToHistory(userStats.getProto());
} }
return "History of user " + userName + ": " + user.getUserData().getMatchHistory() + " " + user.getUserData().getTourneyHistory(); return "History of user " + userName + ": " + user.getUserData().getHistory();
} }
public void updateUserHistory() { public void updateUserHistory() {

View file

@ -171,6 +171,10 @@ public class UserData implements Serializable {
this.autoOrderTrigger = autoOrderTrigger; this.autoOrderTrigger = autoOrderTrigger;
} }
public String getHistory() {
return "Matches:" + this.matchHistory + " Tourneys:" + this.tourneyHistory;
}
public void setMatchHistory(String history) { public void setMatchHistory(String history) {
this.matchHistory = history; this.matchHistory = history;
} }