mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 18:41:23 +01:00
refactor: add poles to state data
This commit is contained in:
parent
b2ab699843
commit
ff5ef1ca4b
3 changed files with 15 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import {WARN} from "config/logging";
|
||||
import {getPolesOfInaccessibility} from "scripts/getPolesOfInaccessibility";
|
||||
import {pick} from "utils/functionUtils";
|
||||
import {getInputNumber} from "utils/nodeUtils";
|
||||
import {collectStatistics} from "./collectStatistics";
|
||||
|
|
@ -70,7 +71,13 @@ export function generateBurgsAndStates(
|
|||
|
||||
const statistics = collectStatistics({...cells, state: stateIds, burg: burgIds}, burgs);
|
||||
const diplomacy = generateRelations(statesData, statistics, pick(cells, "f"));
|
||||
const {states, conflicts} = specifyStates(statesData, statistics, diplomacy, cultures, burgs);
|
||||
const poles = getPolesOfInaccessibility({
|
||||
vertices,
|
||||
getType: (cellId: number) => stateIds[cellId],
|
||||
cellNeighbors: cells.c,
|
||||
cellVertices: cells.v
|
||||
});
|
||||
const {states, conflicts} = specifyStates(statesData, statistics, diplomacy, poles, cultures, burgs);
|
||||
|
||||
return {burgIds, stateIds, burgs, states, conflicts};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue