mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
refactor: Add documentation for markupPack and defineGroups methods in FeatureModule
This commit is contained in:
parent
cf43ca9de1
commit
3e8c7a28a7
1 changed files with 6 additions and 0 deletions
|
|
@ -141,6 +141,9 @@ class FeatureModule {
|
|||
TIME && console.timeEnd("markupGrid");
|
||||
}
|
||||
|
||||
/**
|
||||
* mark PackedGraph features (oceans, lakes, islands) and calculate distance field
|
||||
*/
|
||||
markupPack() {
|
||||
const defineHaven = (cellId: number) => {
|
||||
const waterCells = neighbors[cellId].filter((index: number) => isWater(index, this.packedGraph));
|
||||
|
|
@ -277,6 +280,9 @@ class FeatureModule {
|
|||
TIME && console.timeEnd("markupPack");
|
||||
}
|
||||
|
||||
/**
|
||||
* define feature groups (ocean, sea, gulf, continent, island, isle, freshwater lake, salt lake, etc.)
|
||||
*/
|
||||
defineGroups() {
|
||||
const gridCellsNumber = this.grid.cells.i.length;
|
||||
const OCEAN_MIN_SIZE = gridCellsNumber / 25;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue