refactor: lake name generator

This commit is contained in:
max 2022-07-23 20:10:44 +03:00
parent 4b874246e3
commit b2f16c4b8f
6 changed files with 25 additions and 27 deletions

View file

@ -8,20 +8,6 @@ import {DISTANCE_FIELD, MIN_LAND_HEIGHT} from "config/generation";
import {byId} from "utils/shorthands";
window.Lakes = (function () {
const generateName = function () {
Math.random = aleaPRNG(seed);
for (const feature of pack.features) {
if (feature.type !== "lake") continue;
feature.name = getName(feature);
}
};
const getName = function (feature) {
const landCell = pack.cells.c[feature.firstCell].find(c => pack.cells.h[c] >= 20);
const culture = pack.cells.culture[landCell];
return Names.getCulture(culture);
};
const {LAND_COAST, WATER_COAST} = DISTANCE_FIELD;
function addLakesInDeepDepressions(grid: IGraph & Partial<IGrid>) {

View file

@ -281,7 +281,6 @@ window.Submap = (function () {
BurgsAndStates.drawStateLabels();
Rivers.specify();
Lakes.generateName();
stage("Porting military.");
for (const s of pack.states) {