mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
refactor(es modules): modulize utils
This commit is contained in:
parent
12e1c9f334
commit
7ccebec048
54 changed files with 168 additions and 134 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import {findCell} from "/src/utils/graphUtils";
|
||||
import {rn} from "/src/utils/numberUtils";
|
||||
import {rand, P, rw} from "@/utils/probabilityUtils";
|
||||
import {parseTransform} from "@/utils/stringUtils";
|
||||
|
||||
// update old .map version to the current one
|
||||
export function resolveVersionConflicts(version) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
|
|||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||
import {byId} from "/src/utils/shorthands";
|
||||
import {rn} from "/src/utils/numberUtils";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
|
||||
const $body = insertEditorHtml();
|
||||
addListeners();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {byId} from "/src/utils/shorthands";
|
|||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
||||
import {rn} from "/src/utils/numberUtils";
|
||||
import {rand, P} from "@/utils/probabilityUtils";
|
||||
|
||||
const $body = insertEditorHtml();
|
||||
addListeners();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {shouldRegenerateGrid, generateGrid} from "/src/utils/graphUtils";
|
||||
import {byId} from "/src/utils/shorthands";
|
||||
import {generateSeed} from "@/utils/probabilityUtils";
|
||||
|
||||
const initialSeed = generateSeed();
|
||||
let graph = getGraph(grid);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {byId} from "/src/utils/shorthands";
|
||||
import {tip} from "/src/scripts/tooltips";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
|
||||
appendStyleSheet();
|
||||
insertHtml();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {isWater} from "/src/utils/graphUtils";
|
|||
import {tip} from "/src/scripts/tooltips";
|
||||
import {byId} from "/src/utils/shorthands";
|
||||
import {rn} from "/src/utils/numberUtils";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
|
||||
const entitiesMap = {
|
||||
states: {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import {capitalize} from "@/utils/stringUtils";
|
||||
|
||||
const capitalize = text => text.charAt(0).toUpperCase() + text.slice(1);
|
||||
|
||||
const format = rawList =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue