in progress

This commit is contained in:
evanpelle
2025-02-01 12:05:11 -08:00
committed by Evan
parent 3dbe2784b9
commit 162b6dc349
15 changed files with 234 additions and 91 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { consolex } from "../Consolex";
import {Cell, Game, PlayerType, Tile, TileEvent} from "../game/Game";
import {Cell, Game, PlayerType, Tile} from "../game/Game";
import {PseudoRandom} from "../PseudoRandom";
import {GameID, SpawnIntent} from "../Schemas";
import {bfs, dist as dist, manhattanDist, simpleHash} from "../Util";
+1 -1
View File
@@ -1,4 +1,4 @@
import { Cell, Execution, MutableGame, Game, MutablePlayer, PlayerInfo, TerraNullius, Tile, PlayerType, Alliance, AllianceRequestReplyEvent, Difficulty, UnitType } from "../game/Game";
import { Cell, Execution, MutableGame, Game, MutablePlayer, PlayerInfo, TerraNullius, Tile, PlayerType, Alliance, UnitType } from "../game/Game";
import { AttackIntent, BoatAttackIntentSchema, GameID, Intent, Turn } from "../Schemas";
import { AttackExecution } from "./AttackExecution";
import { SpawnExecution } from "./SpawnExecution";
+1 -1
View File
@@ -1,4 +1,4 @@
import { Unit, Cell, Execution, MutableUnit, MutableGame, MutablePlayer, Player, PlayerID, TerraNullius, Tile, TileEvent, UnitType, TerrainType } from "../game/Game";
import { Unit, Cell, Execution, MutableUnit, MutableGame, MutablePlayer, Player, PlayerID, TerraNullius, Tile, UnitType, TerrainType } from "../game/Game";
import { and, bfs, manhattanDistWrapped, sourceDstOceanShore, targetTransportTile } from "../Util";
import { AttackExecution } from "./AttackExecution";
import { MessageType } from '../game/Game';
+2 -2
View File
@@ -11,7 +11,7 @@ export class WinCheckExecution implements Execution {
private mg: MutableGame
constructor(private eventBus: EventBus) {
constructor() {
}
init(mg: MutableGame, ticks: number) {
@@ -28,7 +28,7 @@ export class WinCheckExecution implements Execution {
}
const max = sorted[0]
if (max.numTilesOwned() / this.mg.terrainMap().numLandTiles() * 100 > this.mg.config().percentageTilesOwnedToWin()) {
this.eventBus.emit(new WinEvent(max))
this.mg.setWinner(max)
this.active = false
}
}