leaderboard works with view

This commit is contained in:
evanpelle
2025-02-01 12:05:11 -08:00
committed by Evan
parent d5e6667b1f
commit 29ad62c2a4
6 changed files with 15 additions and 18 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import {EventBus, GameEvent} from "../EventBus"
import {Execution, MutableGame, MutablePlayer, Player, PlayerID} from "../game/Game"
import { EventBus, GameEvent } from "../EventBus"
import { Execution, MutableGame, MutablePlayer, Player, PlayerID } from "../game/Game"
export class WinEvent implements GameEvent {
constructor(public readonly winner: Player) { }
@@ -27,7 +27,7 @@ export class WinCheckExecution implements Execution {
return
}
const max = sorted[0]
if (max.numTilesOwned() / this.mg.numLandTiles() * 100 > this.mg.config().percentageTilesOwnedToWin()) {
if (max.numTilesOwned() / this.mg.terrainMap().numLandTiles() * 100 > this.mg.config().percentageTilesOwnedToWin()) {
this.eventBus.emit(new WinEvent(max))
this.active = false
}