mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-04-04 14:37:24 +02:00
refactor: migrate resample module (#1351)
* refactor: resampling functionality * fix: type issues * fix: reorder polyfills import in index.ts * refactor: reorder exports in index.ts for consistency
This commit is contained in:
parent
3f9a7702d4
commit
f2fc42799b
20 changed files with 601 additions and 417 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";
|
||||
|
|
@ -541,7 +542,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;
|
||||
};
|
||||
|
||||
|
|
@ -550,7 +551,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