mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 00:11:56 +00:00
remove BuildValidator
This commit is contained in:
@@ -15,7 +15,6 @@ import { ControlPanel } from "./layers/ControlPanel";
|
||||
import { UIState } from "./UIState";
|
||||
import { BuildMenu } from "./layers/radial/BuildMenu";
|
||||
import { UnitLayer } from "./layers/UnitLayer";
|
||||
import { BuildValidator } from "../../core/game/BuildValidator";
|
||||
import { StructureLayer } from "./layers/StructureLayer";
|
||||
|
||||
|
||||
@@ -35,7 +34,6 @@ export function createRenderer(canvas: HTMLCanvasElement, game: Game, eventBus:
|
||||
}
|
||||
buildMenu.game = game
|
||||
buildMenu.eventBus = eventBus
|
||||
buildMenu.buildValidator = new BuildValidator(game)
|
||||
|
||||
const leaderboard = document.querySelector('leader-board') as Leaderboard;
|
||||
if (!emojiTable || !(leaderboard instanceof Leaderboard)) {
|
||||
|
||||
@@ -9,7 +9,6 @@ import missileSiloIcon from '../../../../../resources/images/MissileSiloIconWhit
|
||||
import goldCoinIcon from '../../../../../resources/images/GoldCoinIcon.svg';
|
||||
import portIcon from '../../../../../resources/images/PortIcon.svg';
|
||||
import { renderNumber } from '../../Utils';
|
||||
import { BuildValidator } from '../../../../core/game/BuildValidator';
|
||||
import { ContextMenuEvent } from '../../../InputHandler';
|
||||
|
||||
interface BuildItemDisplay {
|
||||
@@ -30,7 +29,6 @@ const buildTable: BuildItemDisplay[][] = [
|
||||
export class BuildMenu extends LitElement {
|
||||
public game: Game;
|
||||
public eventBus: EventBus;
|
||||
public buildValidator: BuildValidator;
|
||||
private myPlayer: Player;
|
||||
private clickedCell: Cell;
|
||||
|
||||
@@ -152,7 +150,7 @@ export class BuildMenu extends LitElement {
|
||||
if (this.myPlayer == null) {
|
||||
return false
|
||||
}
|
||||
return this.buildValidator.canBuild(this.myPlayer, this.game.tile(this.clickedCell), item.unitType)
|
||||
return this.myPlayer.canBuild(item.unitType, this.game.tile(this.clickedCell))
|
||||
}
|
||||
|
||||
public onBuildSelected = (item: BuildItemDisplay) => {
|
||||
|
||||
Reference in New Issue
Block a user