Skip to content

Commit

Permalink
修复人机的分数没保存的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Oct 31, 2023
1 parent e14359e commit 02b471c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/Game.kt
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ class Game private constructor(totalPlayerCount: Int) {
newScoreMap[p.playerName] = newScore
}
}
val playerGameResultList = ArrayList<PlayerGameResult>()
if (players.size == humanPlayers.size) {
val records = ArrayList<Statistics.Record>(players.size)
val playerGameResultList = ArrayList<PlayerGameResult>()
for (p in players) {
val win = p!! in winners
records.add(
Expand All @@ -240,10 +240,11 @@ class Game private constructor(totalPlayerCount: Int) {
if (p is HumanPlayer) playerGameResultList.add(PlayerGameResult(p.playerName, win))
}
Statistics.add(records)
Statistics.addPlayerGameCount(playerGameResultList)
MiraiPusher.push(this, declaredWinners, winners, addScoreMap, newScoreMap)
}
Statistics.addPlayerGameCount(playerGameResultList)
Statistics.calculateRankList()
if (players.size == humanPlayers.size)
MiraiPusher.push(this, declaredWinners, winners, addScoreMap, newScoreMap)
}
this.players.forEach { it!!.notifyWin(declaredWinners, winners, addScoreMap, newScoreMap) }
}
Expand Down

0 comments on commit 02b471c

Please sign in to comment.