Ranked #306
@ -73,9 +73,9 @@ public class FightEndsHandler implements SpigotHandler {
|
||||
calculateEloOfTeam(fightEndsPacket.getRedSchem(), redSchemElo, blueSchemElo, 1 - blueResult, fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode());
|
||||
}
|
||||
|
||||
private void calculateEloOfTeam(int schemId, int elo1, int elo2, double result, List<Integer> players, String gameMode) {
|
||||
double winExpectation = 1 / (1 + Math.pow(10, (elo1 - elo2) / 600f));
|
||||
SchemElo.setElo(schemId, (int) Math.round(elo1 + K * (result - winExpectation)));
|
||||
private void calculateEloOfTeam(int schemId, int eloOwn, int eloEnemy, double result, List<Integer> players, String gameMode) {
|
||||
double winExpectation = 1 / (1 + Math.pow(10, (eloOwn - eloEnemy) / 600f));
|
||||
SchemElo.setElo(schemId, (int) Math.round(eloOwn + K * (result - winExpectation)));
|
||||
for (int player : players) {
|
||||
YoyoNow markierte diese Unterhaltung als gelöst
Veraltet
|
||||
int playerElo = UserElo.getEloOrDefault(player, gameMode);
|
||||
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + K * (result - winExpectation)));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Du hast hier sehr viel Codedopplung drin, würde mir eine teamunabhängige Abstrahierung wünschen.