mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: ckeanup
This commit is contained in:
parent
fe4d4eac86
commit
bb78d5168b
6 changed files with 23 additions and 93 deletions
|
|
@ -26,11 +26,18 @@ export function createPack(grid: IGrid): IPack {
|
|||
pick(cells, "v", "c", "b", "p", "h")
|
||||
);
|
||||
|
||||
const {heights, flux, r, conf, rivers, mergedFeatures} = generateRivers(
|
||||
grid.cells.prec,
|
||||
grid.cells.temp,
|
||||
const {
|
||||
heights,
|
||||
flux,
|
||||
r,
|
||||
conf,
|
||||
rivers: rawRivers,
|
||||
mergedFeatures
|
||||
} = generateRivers(
|
||||
{...pick(cells, "i", "c", "b", "g", "h", "p"), f: featureIds, t: distanceField, haven},
|
||||
features
|
||||
features,
|
||||
grid.cells.prec,
|
||||
grid.cells.temp
|
||||
);
|
||||
|
||||
// Biomes.define(newPack, grid);
|
||||
|
|
@ -76,7 +83,7 @@ export function createPack(grid: IGrid): IPack {
|
|||
conf
|
||||
},
|
||||
features: mergedFeatures,
|
||||
rivers
|
||||
rivers: rawRivers
|
||||
};
|
||||
|
||||
return pack;
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ const {Rivers} = window;
|
|||
const {LAND_COAST} = DISTANCE_FIELD;
|
||||
|
||||
export function generateRivers(
|
||||
precipitation: IGrid["cells"]["prec"],
|
||||
temperature: IGrid["cells"]["temp"],
|
||||
cells: Pick<IPack["cells"], "i" | "c" | "p" | "b" | "g" | "t" | "h" | "f" | "haven">,
|
||||
features: TPackFeatures
|
||||
features: TPackFeatures,
|
||||
precipitation: IGrid["cells"]["prec"],
|
||||
temperature: IGrid["cells"]["temp"]
|
||||
) {
|
||||
TIME && console.time("generateRivers");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue