minmax util function

This commit is contained in:
Azgaar 2021-10-10 17:59:27 +03:00
parent b202a58db9
commit bdc0c9f8ee
13 changed files with 54 additions and 44 deletions

View file

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