urbanDensity - save/load

This commit is contained in:
Azgaar 2021-10-17 12:01:38 +03:00
parent 3f58b9f362
commit cc82d258fa
5 changed files with 9 additions and 6 deletions

View file

@ -416,7 +416,8 @@ function editBurg(id) {
const {cells} = pack;
const {name, population, cell} = burg;
const burgSeed = getBurgSeed(burg);
const size = Math.max(Math.min(Math.ceil(2.13*Math.pow(population * populationRate/urbanDensity,0.385)), 100), 6);
const sizeRaw = 2.13 * Math.pow((population * populationRate) / urbanDensity, 0.385);
const size = minmax(Math.ceil(sizeRaw), 6, 100);
const people = rn(population * populationRate * urbanization);
const hub = +cells.road[cell] > 50;