Add UserElo.ELO_DEFAULT
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-05-12 17:25:06 +02:00
Ursprung 727a27a9fb
Commit a8270a386c

Datei anzeigen

@ -34,6 +34,8 @@ import java.util.concurrent.ConcurrentHashMap;
@AllArgsConstructor @AllArgsConstructor
public class UserElo { public class UserElo {
private static final int ELO_DEFAULT = 0;
private static final Map<String, Map<Integer, Optional<Integer>>> gameModeUserEloCache = new ConcurrentHashMap<>(); private static final Map<String, Map<Integer, Optional<Integer>>> gameModeUserEloCache = new ConcurrentHashMap<>();
private static final Map<Integer, String> emblemCache = new ConcurrentHashMap<>(); private static final Map<Integer, String> emblemCache = new ConcurrentHashMap<>();
@ -59,7 +61,7 @@ public class UserElo {
private final int elo; private final int elo;
public static int getEloOrDefault(int userID, String gameMode) { public static int getEloOrDefault(int userID, String gameMode) {
return getElo(userID, gameMode).orElse(0); return getElo(userID, gameMode).orElse(ELO_DEFAULT);
} }
public static Optional<Integer> getElo(int userID, String gameMode) { public static Optional<Integer> getElo(int userID, String gameMode) {