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
21fc303320
commit
b8ae515425
15 changed files with 51 additions and 24 deletions
|
|
@ -6,6 +6,7 @@ import {getMiddlePoint} from "@/utils/lineUtils";
|
|||
import {rn, minmax} from "/src/utils/numberUtils";
|
||||
import {rand, P, each, gauss, ra, rw, generateSeed} from "@/utils/probabilityUtils";
|
||||
import {round, splitInTwo} from "@/utils/stringUtils";
|
||||
import {trimVowels, getAdjective} from "@/utils/languageUtils";
|
||||
|
||||
window.BurgsAndStates = (function () {
|
||||
const generate = function () {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import {TIME} from "/src/config/logging";
|
|||
import {getColors} from "/src/utils/colorUtils";
|
||||
import {rn, minmax} from "/src/utils/numberUtils";
|
||||
import {rand, P, rw, biased} from "@/utils/probabilityUtils";
|
||||
import {abbreviate} from "@/utils/languageUtils";
|
||||
|
||||
window.Cultures = (function () {
|
||||
let cells;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {byId} from "/src/utils/shorthands";
|
|||
import {rn} from "/src/utils/numberUtils";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
import {si} from "@/utils/unitUtils";
|
||||
import {abbreviate} from "@/utils/languageUtils";
|
||||
|
||||
const $body = insertEditorHtml();
|
||||
addListeners();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
|||
import {byId} from "/src/utils/shorthands";
|
||||
import {rn} from "/src/utils/numberUtils";
|
||||
import {si} from "@/utils/unitUtils";
|
||||
import {abbreviate} from "@/utils/languageUtils";
|
||||
|
||||
const $body = insertEditorHtml();
|
||||
addListeners();
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
|||
import {rn} from "/src/utils/numberUtils";
|
||||
import {rand, P} from "@/utils/probabilityUtils";
|
||||
import {si} from "@/utils/unitUtils";
|
||||
import {getAdjective} from "@/utils/languageUtils";
|
||||
|
||||
const $body = insertEditorHtml();
|
||||
addListeners();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {rn} from "/src/utils/numberUtils";
|
|||
import {rand, P, gauss, ra, rw} from "@/utils/probabilityUtils";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
import {convertTemperature} from "@/utils/unitUtils";
|
||||
import {getAdjective, list} from "@/utils/languageUtils";
|
||||
|
||||
window.Markers = (function () {
|
||||
let config = [];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import {TIME} from "/src/config/logging";
|
|||
import {rn, minmax} from "/src/utils/numberUtils";
|
||||
import {rand, gauss, ra} from "@/utils/probabilityUtils";
|
||||
import {si} from "@/utils/unitUtils";
|
||||
import {nth} from "@/utils/languageUtils";
|
||||
|
||||
window.Military = (function () {
|
||||
const generate = function () {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {locked} from "/src/scripts/options/lock";
|
|||
import {tip} from "/src/scripts/tooltips";
|
||||
import {rand, P, ra} from "@/utils/probabilityUtils";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
import {vowel} from "@/utils/languageUtils";
|
||||
|
||||
window.Names = (function () {
|
||||
let chains = [];
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {unique} from "/src/utils/arrayUtils";
|
|||
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
||||
import {rn} from "/src/utils/numberUtils";
|
||||
import {rand, P, ra, rw, biased} from "@/utils/probabilityUtils";
|
||||
import {trimVowels, getAdjective, abbreviate} from "@/utils/languageUtils";
|
||||
|
||||
window.Religions = (function () {
|
||||
// name generation approach and relative chance to be selected
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {wiki} from "@/utils/linkUtils";
|
|||
import {rn, minmax} from "/src/utils/numberUtils";
|
||||
import {rand, P, Pint} from "@/utils/probabilityUtils";
|
||||
import {capitalize} from "@/utils/stringUtils";
|
||||
import {getAdjective, list} from "@/utils/languageUtils";
|
||||
|
||||
export class Battle {
|
||||
constructor(attacker, defender) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue