mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: population utils
This commit is contained in:
parent
3125366944
commit
3c850d8d46
22 changed files with 443 additions and 330 deletions
|
|
@ -7,6 +7,7 @@ import {minmax, normalize, rn} from "utils/numberUtils";
|
|||
import {each} from "utils/probabilityUtils";
|
||||
import {byId} from "utils/shorthands";
|
||||
import {parseTransform} from "utils/stringUtils";
|
||||
import {getBurgPopulation} from "utils/unitUtils";
|
||||
|
||||
// clear elSelected variable
|
||||
export function unselect() {
|
||||
|
|
@ -259,7 +260,7 @@ export function getMFCGlink(burg) {
|
|||
|
||||
const sizeRaw = 2.13 * Math.pow((burgPopulation * populationRate) / urbanDensity, 0.385);
|
||||
const size = minmax(Math.ceil(sizeRaw), 6, 100);
|
||||
const population = rn(burgPopulation * populationRate * urbanization);
|
||||
const population = getBurgPopulation(burgPopulation);
|
||||
|
||||
const river = cells.r[cell] ? 1 : 0;
|
||||
const coast = Number(burg.port > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue