mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 00:24:35 +00:00
better UX for boats
This commit is contained in:
@@ -160,7 +160,7 @@ export class AStar {
|
||||
compute(iterations: number): boolean {
|
||||
if (this.completed) return true;
|
||||
|
||||
while (!this.openSet.size()) {
|
||||
while (!this.openSet.isEmpty()) {
|
||||
iterations--
|
||||
this.current = this.openSet.dequeue()!.tile;
|
||||
if (iterations <= 0) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Cell, Game} from "../Game";
|
||||
import {PseudoRandom} from "../PseudoRandom";
|
||||
import {SpawnIntent} from "../Schemas";
|
||||
import {bfs} from "../Util";
|
||||
import {bfs, dist as dist} from "../Util";
|
||||
import {getSpawnCells} from "./Util";
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export class BotSpawner {
|
||||
spawnBot(botName: string): SpawnIntent {
|
||||
const rand = this.random.nextInt(0, this.numFreeTiles);
|
||||
const spawn = this.freeTiles[rand];
|
||||
bfs(this.gs.tile(spawn), 50).forEach(t => this.removeCell(t.cell()))
|
||||
bfs(this.gs.tile(spawn), dist(50)).forEach(t => this.removeCell(t.cell()))
|
||||
const spawnIntent: SpawnIntent = {
|
||||
type: 'spawn',
|
||||
name: botName,
|
||||
|
||||
Reference in New Issue
Block a user