mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: lake name generator
This commit is contained in:
parent
4b874246e3
commit
b2f16c4b8f
6 changed files with 25 additions and 27 deletions
|
|
@ -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>) {
|
||||
|
|
|
|||
|
|
@ -281,7 +281,6 @@ window.Submap = (function () {
|
|||
BurgsAndStates.drawStateLabels();
|
||||
|
||||
Rivers.specify();
|
||||
Lakes.generateName();
|
||||
|
||||
stage("Porting military.");
|
||||
for (const s of pack.states) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue