mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 08:55:04 +00:00
remove BuildValidator
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { BuildValidator } from "../game/BuildValidator";
|
||||
import { AllPlayers, Cell, Execution, MutableGame, MutablePlayer, MutableUnit, Player, PlayerID, Tile, Unit, UnitType } from "../game/Game";
|
||||
import { AStar, PathFinder } from "../PathFinding";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
@@ -30,7 +29,7 @@ export class PortExecution implements Execution {
|
||||
tick(ticks: number): void {
|
||||
if (this.port == null) {
|
||||
const tile = this.mg.tile(this.cell)
|
||||
if (!new BuildValidator(this.mg).canBuild(this.player, tile, UnitType.Port)) {
|
||||
if (!this.player.canBuild(UnitType.Port, tile)) {
|
||||
console.warn(`player ${this.player} cannot build port at ${this.cell}`)
|
||||
this.active = false
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user