Skip to content

Commit

Permalink
修改至尊段位的符号
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Feb 10, 2025
1 parent e22a13d commit 86f4874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/ScoreFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ object ScoreFactory : Logging {
score < 1000 -> "\uD83D\uDC8D" + rankString[4 - (score - 600) / 80]
score < 1500 -> "\uD83D\uDCA0" + rankString[4 - (score - 1000) / 100]
score < 2000 -> "\uD83D\uDC51" + rankString[4 - (score - 1500) / 100]
score < 2900 -> "\u2B50" + rankString[9 - (score - 2000) / 100]
else -> "\u2B50" + rankString[0]
score < 2900 -> "\u2600\uFE0F" + rankString[9 - (score - 2000) / 100]
else -> "\u2600\uFE0F" + rankString[0]
}

fun getSeasonTitleByScore(score: Int): String = when {
score >= 2900 -> "\u2B50"
score >= 2900 -> "\u2600\uFE0F"
score >= 1900 -> "\uD83D\uDC51"
score >= 1400 -> "\uD83D\uDCA0"
score >= 920 -> "\uD83D\uDC8D"
Expand Down
13 changes: 3 additions & 10 deletions src/main/kotlin/Statistics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ object Statistics {
get() = PlayerGameCount(totalWinCount.get(), totalGameCount.get())

fun getTitleRank(title: String): Int = when (title) {
"\u2B50" -> 1 // score >= 2900
"\u2600\uFE0F" -> 1 // score >= 2900
"\uD83D\uDC51" -> 2 // score >= 1900
"\uD83D\uDCA0" -> 3 // score >= 1400
"\uD83D\uDC8D" -> 4 // score >= 920
Expand All @@ -310,15 +310,8 @@ object Statistics {
val titleList = mutableListOf<String>()
var i = 0
while (i < titles.length) {
if (titles[i] == '\u2B50') {
// 如果是单字符 emoji(⭐)
titleList.add(titles[i].toString())
i += 1
} else {
// 处理其他双字符 emoji
titleList.add(titles.substring(i, i + 2))
i += 2
}
titleList.add(titles.substring(i, i + 2))
i += 2
}
return titleList.sortedBy { getTitleRank(it) }.joinToString("")
}
Expand Down

0 comments on commit 86f4874

Please sign in to comment.