refactor: Add documentation for markupPack and defineGroups methods in FeatureModule

This commit is contained in:
Marc Emmanuel 2026-01-20 07:44:48 +01:00
parent cf43ca9de1
commit 3e8c7a28a7

View file

@ -141,6 +141,9 @@ class FeatureModule {
TIME && console.timeEnd("markupGrid"); TIME && console.timeEnd("markupGrid");
} }
/**
* mark PackedGraph features (oceans, lakes, islands) and calculate distance field
*/
markupPack() { markupPack() {
const defineHaven = (cellId: number) => { const defineHaven = (cellId: number) => {
const waterCells = neighbors[cellId].filter((index: number) => isWater(index, this.packedGraph)); const waterCells = neighbors[cellId].filter((index: number) => isWater(index, this.packedGraph));
@ -277,6 +280,9 @@ class FeatureModule {
TIME && console.timeEnd("markupPack"); TIME && console.timeEnd("markupPack");
} }
/**
* define feature groups (ocean, sea, gulf, continent, island, isle, freshwater lake, salt lake, etc.)
*/
defineGroups() { defineGroups() {
const gridCellsNumber = this.grid.cells.i.length; const gridCellsNumber = this.grid.cells.i.length;
const OCEAN_MIN_SIZE = gridCellsNumber / 25; const OCEAN_MIN_SIZE = gridCellsNumber / 25;