refactor: ckeanup

This commit is contained in:
max 2022-07-24 18:06:55 +03:00
parent fe4d4eac86
commit bb78d5168b
6 changed files with 23 additions and 93 deletions

View file

@ -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;

View file

@ -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");