mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-26 14:12:44 +00:00
have core/ directory use consolex for remote logging
This commit is contained in:
@@ -4,6 +4,7 @@ import { AStar, PathFindResultType, SearchNode, TileResult } from "./AStar";
|
||||
import { ParallelAStar, WorkerClient } from "../worker/WorkerClient";
|
||||
import { SerialAStar } from "./SerialAStar";
|
||||
import { MiniAStar } from "./MiniAStar";
|
||||
import { consolex } from "../Consolex";
|
||||
|
||||
export class PathFinder {
|
||||
|
||||
@@ -65,10 +66,10 @@ export class PathFinder {
|
||||
|
||||
nextTile(curr: Tile, dst: Tile, dist: number = 1): TileResult {
|
||||
if (curr == null) {
|
||||
console.error('curr is null')
|
||||
consolex.error('curr is null')
|
||||
}
|
||||
if (dst == null) {
|
||||
console.error('dst is null')
|
||||
consolex.error('dst is null')
|
||||
}
|
||||
|
||||
if (manhattanDist(curr.cell(), dst.cell()) < dist) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { PriorityQueue } from "@datastructures-js/priority-queue";
|
||||
import { AStar, SearchNode } from "./AStar";
|
||||
import { PathFindResultType } from "./AStar";
|
||||
import { Cell } from "../game/Game";
|
||||
import { consolex } from "../Consolex";
|
||||
|
||||
|
||||
export class SerialAStar implements AStar {
|
||||
@@ -111,7 +112,7 @@ export class SerialAStar implements AStar {
|
||||
try {
|
||||
return 1.1 * Math.abs(a.cell().x - b.cell().x) + Math.abs(a.cell().y - b.cell().y);
|
||||
} catch {
|
||||
console.log('uh oh')
|
||||
consolex.log('uh oh')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user