Move pathfinding into routinglib; call routinglib for pathfinding jobs

This commit is contained in:
Manuel Vögele
2022-09-30 21:52:27 +02:00
parent 4b30d52da1
commit c21e4c91d6
18 changed files with 94 additions and 1809 deletions
-14
View File
@@ -14,29 +14,15 @@ import {disableSnap, registerKeybindings} from "./keybindings.js";
import {libWrapper} from "./libwrapper_shim.js";
import {performMigrations} from "./migration.js";
import {removeLastHistoryEntryIfAt, resetMovementHistory} from "./movement_tracking.js";
import {wipePathfindingCache, initializePathfinding} from "./pathfinding.js";
import {extendRuler} from "./ruler.js";
import {registerSettings, RightClickAction, settingsKey} from "./settings.js";
import {recalculate} from "./socket.js";
import {SpeedProvider} from "./speed_provider.js";
import {setSnapParameterOnOptions} from "./util.js";
import initGridlessPathfinding, * as GridlessPathfinding from "../wasm/gridless_pathfinding.js";
CONFIG.debug.dragRuler = false;
export let debugGraphics = undefined;
initGridlessPathfinding().then(() => {
Hooks.on("canvasInit", wipePathfindingCache);
Hooks.on("canvasReady", () => {
wipePathfindingCache();
initializePathfinding();
});
Hooks.on("createWall", wipePathfindingCache);
Hooks.on("updateWall", wipePathfindingCache);
Hooks.on("deleteWall", wipePathfindingCache);
});
Hooks.once("init", () => {
registerSettings();
registerKeybindings();