mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: river generation start
This commit is contained in:
parent
4833a8ab35
commit
4e65616dbc
11 changed files with 285 additions and 265 deletions
36
src/types/pack/feature.d.ts
vendored
Normal file
36
src/types/pack/feature.d.ts
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
interface IPackFeatureBase {
|
||||
i: number; // feature id starting from 1
|
||||
border: boolean; // if touches map border
|
||||
cells: number; // number of cells
|
||||
firstCell: number; // index of the top left cell
|
||||
vertices: number[]; // indexes of perimetric vertices
|
||||
area: number; // area of the feature perimetric polygon
|
||||
}
|
||||
3;
|
||||
|
||||
interface IPackFeatureOcean extends IPackFeatureBase {
|
||||
land: false;
|
||||
type: "ocean";
|
||||
group: "ocean" | "sea" | "gulf";
|
||||
}
|
||||
|
||||
interface IPackFeatureIsland extends IPackFeatureBase {
|
||||
land: true;
|
||||
type: "island";
|
||||
group: "continent" | "island" | "isle" | "lake_island";
|
||||
}
|
||||
|
||||
interface IPackFeatureLake extends IPackFeatureBase {
|
||||
land: false;
|
||||
type: "lake";
|
||||
group: "freshwater" | "salt" | "frozen" | "dry" | "sinkhole" | "lava";
|
||||
name: string;
|
||||
shoreline: number[];
|
||||
height: number;
|
||||
}
|
||||
|
||||
type TPackFeature = IPackFeatureOcean | IPackFeatureIsland | IPackFeatureLake;
|
||||
|
||||
type FirstElement = 0;
|
||||
|
||||
type TPackFeatures = [FirstElement, ...TPackFeature[]];
|
||||
31
src/types/pack.d.ts → src/types/pack/pack.d.ts
vendored
31
src/types/pack.d.ts → src/types/pack/pack.d.ts
vendored
|
|
@ -37,37 +37,6 @@ interface IPackBase extends IGraph {
|
|||
features?: TPackFeatures;
|
||||
}
|
||||
|
||||
interface IPackFeatureBase {
|
||||
i: number; // feature id starting from 1
|
||||
border: boolean; // if touches map border
|
||||
cells: number; // number of cells
|
||||
firstCell: number; // index of the top left cell
|
||||
vertices: number[]; // indexes of perimetric vertices
|
||||
}
|
||||
|
||||
interface IPackFeatureOcean extends IPackFeatureBase {
|
||||
land: false;
|
||||
type: "ocean";
|
||||
group: "ocean" | "sea" | "gulf";
|
||||
}
|
||||
|
||||
interface IPackFeatureIsland extends IPackFeatureBase {
|
||||
land: true;
|
||||
type: "island";
|
||||
group: "continent" | "island" | "isle" | "lake_island";
|
||||
}
|
||||
|
||||
interface IPackFeatureLake extends IPackFeatureBase {
|
||||
land: false;
|
||||
type: "lake";
|
||||
group: "freshwater" | "salt" | "frozen" | "dry" | "sinkhole" | "lava";
|
||||
name: string;
|
||||
}
|
||||
|
||||
type TPackFeature = IPackFeatureOcean | IPackFeatureIsland | IPackFeatureLake;
|
||||
|
||||
type TPackFeatures = [0, ...TPackFeature[]];
|
||||
|
||||
interface IState {
|
||||
i: number;
|
||||
name: string;
|
||||
Loading…
Add table
Add a link
Reference in a new issue