mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor(es modules): continue migration
This commit is contained in:
parent
bc65e0e207
commit
97f2b213c4
42 changed files with 252 additions and 222 deletions
21
src/main.ts
21
src/main.ts
|
|
@ -3,14 +3,22 @@
|
|||
|
||||
import {PRODUCTION, UINT16_MAX} from "./constants";
|
||||
import {INFO, TIME, WARN, ERROR} from "./config/logging";
|
||||
import {createTypedArray} from "./utils";
|
||||
import {shouldRegenerateGrid, generateGrid, calculateVoronoi, getPackPolygon, isLand} from "./utils/graphUtils";
|
||||
import {
|
||||
shouldRegenerateGrid,
|
||||
generateGrid,
|
||||
calculateVoronoi,
|
||||
getPackPolygon,
|
||||
isLand,
|
||||
findCell
|
||||
} from "./utils/graphUtils";
|
||||
import {createTypedArray} from "./utils/arrayUtils";
|
||||
import {drawRivers, drawStates, drawBorders} from "../modules/ui/layers";
|
||||
import {invokeActiveZooming} from "../modules/activeZooming";
|
||||
import {applyStoredOptions, applyMapSize, randomizeOptions} from "../modules/ui/options";
|
||||
import {locked} from "../modules/ui/general";
|
||||
import {Rulers, Ruler, drawScaleBar} from "./modules/measurers";
|
||||
|
||||
globalThis.fmg = {
|
||||
window.fmg = {
|
||||
modules: {}
|
||||
};
|
||||
|
||||
|
|
@ -931,10 +939,9 @@ function drawCoastline() {
|
|||
TIME && console.time("drawCoastline");
|
||||
reMarkFeatures();
|
||||
|
||||
const cells = pack.cells,
|
||||
vertices = pack.vertices,
|
||||
n = cells.i.length,
|
||||
features = pack.features;
|
||||
const {cells, vertices, features} = pack;
|
||||
const n = cells.i.length;
|
||||
|
||||
const used = new Uint8Array(features.length); // store connected features
|
||||
const largestLand = d3.scan(
|
||||
features.map(f => (f.land ? f.cells : 0)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue