mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
migrating all util files from js to ts
This commit is contained in:
parent
76f86497c7
commit
fa493989b6
39 changed files with 3174 additions and 1523 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,3 +133,5 @@ class Voronoi {
|
|||
];
|
||||
}
|
||||
}
|
||||
|
||||
window.Voronoi = Voronoi;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue