mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: render provinces
This commit is contained in:
parent
4dc5648310
commit
b2ab699843
12 changed files with 136 additions and 127 deletions
|
|
@ -3,13 +3,15 @@ import {getInputNumber} from "utils/nodeUtils";
|
|||
import {expandProvinces} from "./expandProvinces";
|
||||
import {generateCoreProvinces} from "./generateCoreProvinces";
|
||||
import {generateWildProvinces} from "./generateWildProvinces";
|
||||
import {specifyProvinces} from "./specifyProvinces";
|
||||
|
||||
export function generateProvinces(
|
||||
states: TStates,
|
||||
burgs: TBurgs,
|
||||
cultures: TCultures,
|
||||
features: TPackFeatures,
|
||||
cells: Pick<IPack["cells"], "i" | "c" | "h" | "t" | "f" | "culture" | "state" | "burg">
|
||||
vertices: IGraphVertices,
|
||||
cells: Pick<IPack["cells"], "i" | "c" | "v" | "h" | "t" | "f" | "culture" | "state" | "burg">
|
||||
): {provinceIds: Uint16Array; provinces: TProvinces} {
|
||||
TIME && console.time("generateProvinces");
|
||||
|
||||
|
|
@ -30,7 +32,7 @@ export function generateProvinces(
|
|||
cells
|
||||
}); // mutates provinceIds
|
||||
|
||||
const provinces: TProvinces = [0, ...coreProvinces, ...wildProvinces];
|
||||
const provinces = specifyProvinces(provinceIds, coreProvinces, wildProvinces, vertices, cells.c, cells.v);
|
||||
|
||||
TIME && console.timeEnd("generateProvinces");
|
||||
return {provinceIds, provinces};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue