From cd9242ce26faed0700651a8396fdd539b6d18db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E8=91=A9=E3=81=AE=E7=81=B5=E6=A2=A6?= Date: Mon, 2 Dec 2024 20:08:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=A5=9E=E7=A7=98?= =?UTF-8?q?=E4=BA=BA=E4=BB=BB=E5=8A=A1=E7=BB=9F=E8=AE=A1=E5=9C=BA=E6=AC=A1?= =?UTF-8?q?=E8=83=9C=E7=8E=87=E7=9A=84=E9=94=99=E8=AF=AF=20(#310)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/Statistics.kt | 48 +---------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/src/main/kotlin/Statistics.kt b/src/main/kotlin/Statistics.kt index dc473538..3f23016e 100644 --- a/src/main/kotlin/Statistics.kt +++ b/src/main/kotlin/Statistics.kt @@ -77,57 +77,11 @@ object Statistics { val now = System.currentTimeMillis() var win = 0 var game = 0 - var rbwin = 0 - var rbgame = 0 - var blackwin = 0 - var blackgame = 0 - var killerwin = 0 - var killergame = 0 - var stealerwin = 0 - var stealergame = 0 - var collectorwin = 0 - var collectorgame = 0 - var mutatorwin = 0 - var mutatorgame = 0 - var pioneerwin = 0 - var pioneergame = 0 - var disturberwin = 0 - var disturbergame = 0 - var sweeperwin = 0 - var sweepergame = 0 var updateTrial = false for (count in playerGameResultList) { if (count.isWin) { - if (count.identity == Black) { - blackwin++ - when (count.secret_task) { - Killer -> killerwin++ - Stealer -> stealerwin++ - Collector -> collectorwin++ - Mutator -> mutatorwin++ - Pioneer -> pioneerwin++ - Disturber -> disturberwin++ - Sweeper -> sweeperwin++ - else -> {} - } - } else rbwin++ - win++ if (trialStartTime.remove(count.playerName) != null) updateTrial = true } - if (count.identity == Black) { - blackgame++ - when (count.secret_task) { - Killer -> killergame++ - Stealer -> stealergame++ - Collector -> collectorgame++ - Mutator -> mutatorgame++ - Pioneer -> pioneergame++ - Disturber -> disturbergame++ - Sweeper -> sweepergame++ - else -> {} - } - } else rbgame++ - game++ playerInfoMap.computeIfPresent(count.playerName) { _, v -> val addWin = if (count.isWin) 1 else 0 val addRbWin = if (count.isWin && count.identity != Black) 1 else 0 @@ -138,7 +92,7 @@ object Statistics { val addRbGame = if (count.identity != Black) 1 else 0 val addBlackGame = if (count.identity == Black) 1 else 0 val newBlacksGame = if (count.identity == Black) - v.blacksGameCount + (count.secret_task to ((v.blacksWinCount[count.secret_task] ?: 0) + 1)) + v.blacksGameCount + (count.secret_task to ((v.blacksGameCount[count.secret_task] ?: 0) + 1)) else v.blacksGameCount v.copy(winCount = v.winCount + addWin, gameCount = v.gameCount + 1, lastTime = now,