mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 18:04:24 +00:00
in progress
This commit is contained in:
@@ -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,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,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';
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user