migrating all util files from js to ts

This commit is contained in:
Marc Emmanuel 2026-01-14 09:18:08 +01:00
parent 76f86497c7
commit fa493989b6
39 changed files with 3174 additions and 1523 deletions

View file

@ -271,7 +271,7 @@ window.Military = (function () {
}
if (node.t > expected) return;
const r = (expected - node.t) / (node.s ? 40 : 20); // search radius
const candidates = tree.findAll(node.x, node.y, r);
const candidates = findAllInQuadtree(node.x, node.y, r, tree);
for (const c of candidates) {
if (c.t < expected && mergeable(node, c)) {
merge(node, c);

View file

@ -201,7 +201,7 @@ function editReliefIcon() {
d3.event.on("drag", function () {
const p = d3.mouse(this);
moveCircle(p[0], p[1], r);
tree.findAll(p[0], p[1], r).forEach(f => f[2].remove());
findAllInQuadtree(p[0], p[1], r, tree).forEach(f => f[2].remove());
});
}

View file

@ -133,3 +133,5 @@ class Voronoi {
];
}
}
window.Voronoi = Voronoi;