leaderboard shows percentage non-fallout tiles owned

This commit is contained in:
Evan
2025-02-01 12:05:11 -08:00
parent 7a2f4210ed
commit 7325cfc7e6
5 changed files with 39 additions and 27 deletions
+3 -1
View File
@@ -53,12 +53,14 @@ export class Leaderboard extends LitElement implements Layer {
const sorted = this.game.playerViews()
.sort((a, b) => b.numTilesOwned() - a.numTilesOwned())
const numTilesWithoutFallout = this.game.numLandTiles() - this.game.numTilesWithFallout()
this.players = sorted
.slice(0, 5)
.map((player, index) => ({
name: player.displayName(),
position: index + 1,
score: formatPercentage(player.numTilesOwned() / this.game.numLandTiles()),
score: formatPercentage(player.numTilesOwned() / numTilesWithoutFallout),
gold: renderNumber(player.gold()),
isMyPlayer: player == myPlayer,
player: player