From 8c448602e13a13ecfe7f1b913de8ba3171c42e26 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Mon, 17 Jan 2022 13:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E6=A6=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E5=86=8Dat=20=E4=B8=94=E4=BB=85=E5=88=97=E5=87=BA?= =?UTF-8?q?=E6=9C=AC=E7=BE=A4=E6=8E=92=E5=90=8D=20=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E6=8F=90=E4=BA=A4=E6=94=B9=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/JHorseRacing.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/JHorseRacing.kt b/src/main/kotlin/JHorseRacing.kt index ef0f6cf..355508c 100644 --- a/src/main/kotlin/JHorseRacing.kt +++ b/src/main/kotlin/JHorseRacing.kt @@ -19,7 +19,7 @@ import net.mamoe.mirai.utils.info import top.jie65535.jhr.game.Bet import top.jie65535.jhr.game.Horse import top.jie65535.jhr.game.PlayerStatistics -import java.lang.Integer.max +import java.lang.Integer.min import java.util.* import kotlin.random.Random @@ -98,7 +98,7 @@ object JHorseRacing : KotlinPlugin( for (j in horse.position until lapLength) sb.append("Ξ") sb.append(horseTypes[horse.type]) - for (j in 0 until max(lapLength, horse.position)) + for (j in 0 until min(lapLength, horse.position)) sb.append("Ξ") sb.appendLine() } @@ -435,10 +435,11 @@ object JHorseRacing : KotlinPlugin( msg == "排名" || msg == "积分榜" -> { val msgB = MessageChainBuilder(11) msgB.append("积分榜\n") - JHRPluginData.Scores.entries.sortedByDescending { it.value } + JHRPluginData.Scores.entries.filter { subject.contains(it.key) } + .sortedByDescending { it.value } .take(10) .onEach { - msgB.append(At(it.key)).append(" ${it.value}\n") + msgB.append("${subject[it.key]!!.nameCard} | ${it.value} |\n") } subject.sendMessage(msgB.asMessageChain()) }