mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
refactor: generate conflicts
This commit is contained in:
parent
136e71eae9
commit
a2192fb984
7 changed files with 190 additions and 47 deletions
|
|
@ -4,6 +4,7 @@ import {createAreaTiers, defineStateForm} from "./defineStateForm";
|
|||
import {defineFullStateName, defineStateName} from "./defineStateName";
|
||||
import {defineStateColors} from "./defineStateColors";
|
||||
import {isBurg} from "utils/typeUtils";
|
||||
import {generateConflicts} from "./generateConflicts";
|
||||
|
||||
import type {TStateStatistics} from "./collectStatistics";
|
||||
import type {TStateData} from "./createStateData";
|
||||
|
|
@ -32,13 +33,15 @@ export function specifyStates(
|
|||
if (!capitalName) throw new Error("State capital is not a burg");
|
||||
|
||||
const relations = diplomacy[i];
|
||||
const isVassal = relations.includes("Vassal");
|
||||
|
||||
const nameBase = getNameBase(culture);
|
||||
const areaTier = getAreaTier(area);
|
||||
const {form, formName} = defineStateForm(type, areaTier, nameBase, burgsNumber, relations, neighbors);
|
||||
const {form, formName} = defineStateForm(type, areaTier, nameBase, burgsNumber, neighbors, isVassal);
|
||||
const name = defineStateName(center, capitalName, nameBase, formName);
|
||||
const fullName = defineFullStateName(name, formName);
|
||||
|
||||
const state: IState = {
|
||||
return {
|
||||
name,
|
||||
...stateData,
|
||||
form,
|
||||
|
|
@ -51,9 +54,12 @@ export function specifyStates(
|
|||
neighbors,
|
||||
relations
|
||||
};
|
||||
return state;
|
||||
});
|
||||
|
||||
const wars = generateConflicts(states); // mutates states
|
||||
console.log(wars);
|
||||
console.log(states);
|
||||
|
||||
TIME && console.timeEnd("specifyStates");
|
||||
return [NEUTRALS, ...states];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue