mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-23 23:57:23 +01:00
refactor: resampling functionality
This commit is contained in:
parent
7a49098425
commit
3b74674a09
15 changed files with 590 additions and 811 deletions
|
|
@ -7,6 +7,7 @@ import {
|
|||
type Vertices,
|
||||
Voronoi,
|
||||
} from "../modules/voronoi";
|
||||
import type { PackedGraph } from "../types/PackedGraph";
|
||||
import { createTypedArray } from "./arrayUtils";
|
||||
import { rn } from "./numberUtils";
|
||||
import { byId } from "./shorthands";
|
||||
|
|
@ -525,7 +526,7 @@ export function* poissonDiscSampler(
|
|||
* @param {number} i - The index of the packed cell
|
||||
* @returns {boolean} - True if the cell is land, false otherwise
|
||||
*/
|
||||
export const isLand = (i: number, packedGraph: any) => {
|
||||
export const isLand = (i: number, packedGraph: PackedGraph) => {
|
||||
return packedGraph.cells.h[i] >= 20;
|
||||
};
|
||||
|
||||
|
|
@ -534,7 +535,7 @@ export const isLand = (i: number, packedGraph: any) => {
|
|||
* @param {number} i - The index of the packed cell
|
||||
* @returns {boolean} - True if the cell is water, false otherwise
|
||||
*/
|
||||
export const isWater = (i: number, packedGraph: any) => {
|
||||
export const isWater = (i: number, packedGraph: PackedGraph) => {
|
||||
return packedGraph.cells.h[i] < 20;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue