have core/ directory use consolex for remote logging

This commit is contained in:
evanpelle
2024-12-18 12:00:00 -08:00
parent 642d5dc4ca
commit ff02d9d8b6
31 changed files with 91 additions and 66 deletions
+3 -2
View File
@@ -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 -1
View File
@@ -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')
}
}