mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: voronoi
This commit is contained in:
parent
e59b536e83
commit
00d8d28d76
16 changed files with 1912 additions and 171 deletions
2
src/types/graph.d.ts
vendored
2
src/types/graph.d.ts
vendored
|
|
@ -12,7 +12,7 @@ interface IGraphVertices {
|
|||
|
||||
interface IGraphCells {
|
||||
i: UintArray;
|
||||
b: UintArray;
|
||||
b: (0 | 1)[];
|
||||
c: number[][];
|
||||
v: number[][];
|
||||
}
|
||||
|
|
|
|||
9
src/types/pack.d.ts
vendored
9
src/types/pack.d.ts
vendored
|
|
@ -1,5 +1,5 @@
|
|||
interface IPack extends IGraph {
|
||||
cells: IPackCells;
|
||||
cells: IGraphCells & IPackCells;
|
||||
features: TPackFeatures;
|
||||
states: IState[];
|
||||
cultures: ICulture[];
|
||||
|
|
@ -9,7 +9,7 @@ interface IPack extends IGraph {
|
|||
religions: IReligion[];
|
||||
}
|
||||
|
||||
interface IPackCells extends IGraphCells {
|
||||
interface IPackCells {
|
||||
p: TPoints; // cell center points
|
||||
h: Uint8Array; // heights, [0, 100], see MIN_LAND_HEIGHT constant
|
||||
t: Int8Array; // see DISTANCE_FIELD enum
|
||||
|
|
@ -32,6 +32,11 @@ interface IPackCells extends IGraphCells {
|
|||
q: d3.Quadtree<number[]>;
|
||||
}
|
||||
|
||||
interface IPackBase extends IGraph {
|
||||
cells: IGraphCells & Partial<IPackCells>;
|
||||
features?: TPackFeatures;
|
||||
}
|
||||
|
||||
interface IPackFeatureBase {
|
||||
i: number; // feature id starting from 1
|
||||
border: boolean; // if touches map border
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue