mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: grid generation
This commit is contained in:
parent
d18636eb8f
commit
e59b536e83
15 changed files with 157 additions and 105 deletions
20
src/types/grid.d.ts
vendored
20
src/types/grid.d.ts
vendored
|
|
@ -5,16 +5,26 @@ interface IGrid extends IGraph {
|
|||
spacing: number;
|
||||
boundary: TPoints;
|
||||
points: TPoints;
|
||||
cells: IGridCells;
|
||||
cells: IGraphCells & IGridCells;
|
||||
features: TGridFeatures;
|
||||
}
|
||||
|
||||
interface IGridCells extends IGraphCells {
|
||||
h: UintArray; // heights, [0, 100], see MIN_LAND_HEIGHT constant
|
||||
interface IGridCells {
|
||||
h: Uint8Array; // heights, [0, 100], see MIN_LAND_HEIGHT constant
|
||||
t: Int8Array; // see DISTANCE_FIELD enum
|
||||
f: Uint16Array; // feature id, see IGridFeature
|
||||
temp: UintArray; // temparature in Celsius
|
||||
prec: UintArray; // precipitation in inner units
|
||||
temp: Int8Array; // temparature in Celsius
|
||||
prec: Uint8Array; // precipitation in inner units
|
||||
}
|
||||
|
||||
interface IGridBase extends IGrid {
|
||||
cells: IGraphCells & Partial<IGridCells>;
|
||||
features?: TGridFeatures;
|
||||
}
|
||||
|
||||
interface IGridWithHeights extends IGrid {
|
||||
cells: IGraphCells & Partial<IGridCells> & {h: Uint8Array};
|
||||
features?: TGridFeatures;
|
||||
}
|
||||
|
||||
type TGridFeatures = [0, ...IGridFeature[]];
|
||||
|
|
|
|||
25
src/types/overrides.d.ts
vendored
25
src/types/overrides.d.ts
vendored
|
|
@ -6,16 +6,23 @@ interface Navigator {
|
|||
|
||||
interface Window {
|
||||
mapCoordinates: IMapCoordinates;
|
||||
$: typeof $;
|
||||
$: typeof $; // jQuery
|
||||
|
||||
// untyped IIFE modules
|
||||
Biomes: typeof Biomes;
|
||||
Names: typeof Names;
|
||||
ThreeD: typeof ThreeD;
|
||||
ReliefIcons: typeof ReliefIcons;
|
||||
Zoom: typeof Zoom;
|
||||
Lakes: typeof Lakes;
|
||||
HeightmapGenerator: typeof HeightmapGenerator;
|
||||
OceanLayers: typeof OceanLayers;
|
||||
Biomes: any;
|
||||
Names: any;
|
||||
ThreeD: any;
|
||||
ReliefIcons: any;
|
||||
Zoom: any;
|
||||
Lakes: any;
|
||||
HeightmapGenerator: any;
|
||||
OceanLayers: any;
|
||||
Rivers: any;
|
||||
Cultures: any;
|
||||
BurgsAndStates: any;
|
||||
Religions: any;
|
||||
Military: any;
|
||||
Markers: any;
|
||||
}
|
||||
|
||||
interface Node {
|
||||
|
|
|
|||
2
src/types/pack.d.ts
vendored
2
src/types/pack.d.ts
vendored
|
|
@ -11,7 +11,7 @@ interface IPack extends IGraph {
|
|||
|
||||
interface IPackCells extends IGraphCells {
|
||||
p: TPoints; // cell center points
|
||||
h: UintArray; // heights, [0, 100], see MIN_LAND_HEIGHT constant
|
||||
h: Uint8Array; // heights, [0, 100], see MIN_LAND_HEIGHT constant
|
||||
t: Int8Array; // see DISTANCE_FIELD enum
|
||||
f: Uint16Array; // feature id, see TPackFeature
|
||||
g: UintArray;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue