Skip to content

Commit

Permalink
fix: role
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Aug 6, 2021
1 parent 685843a commit a7e35ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/xyz/cssxsh/mirai/plugin/ArknightsTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ internal fun tag(words: List<String>, tags: Set<String> = ExcelData.gacha.tags()

internal fun recruit(words: List<String>) = ExcelData.characters.recruit(tag(words), ExcelData.gacha.recruit())

internal fun role(name: String, roles: Set<String> = ExcelData.gacha.recruit()): String {
return when (name) {
in roles -> name.trim()
in RoleAlias -> RoleAlias.getValue(name.trim())
else -> throw IllegalArgumentException("未知干员: ${name.trim()}")
internal fun role(name: String, roles: Set<String> = ExcelData.gacha.recruit()) = name.trim().let {
when (it) {
in roles -> it
in RoleAlias -> RoleAlias.getValue(it)
else -> throw IllegalArgumentException("未知干员: ${it}")
}
}

Expand Down

0 comments on commit a7e35ae

Please sign in to comment.