mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-04-03 22:17:24 +02:00
refactor: replace deepCopy with structuredClone
This commit is contained in:
parent
7a49098425
commit
1116cc5e0f
9 changed files with 123 additions and 142 deletions
|
|
@ -1141,7 +1141,6 @@ function reGraph() {
|
|||
pack.cells = packCells;
|
||||
pack.cells.p = newCells.p;
|
||||
pack.cells.g = createTypedArray({maxValue: grid.points.length, from: newCells.g});
|
||||
pack.cells.q = d3.quadtree(newCells.p.map(([x, y], i) => [x, y, i]));
|
||||
pack.cells.h = createTypedArray({maxValue: 100, from: newCells.h});
|
||||
pack.cells.area = createTypedArray({maxValue: UINT16_MAX, length: packCells.i.length}).map((_, cellId) => {
|
||||
const area = Math.abs(d3.polygonArea(getPackPolygon(cellId)));
|
||||
|
|
@ -1234,7 +1233,7 @@ function showStatistics() {
|
|||
INFO && console.info(stats);
|
||||
|
||||
// Dispatch event for test automation and external integrations
|
||||
window.dispatchEvent(new CustomEvent('map:generated', { detail: { seed, mapId } }));
|
||||
window.dispatchEvent(new CustomEvent("map:generated", {detail: {seed, mapId}}));
|
||||
}
|
||||
|
||||
const regenerateMap = debounce(async function (options) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue