refactor: generate historical conflicts

This commit is contained in:
Azgaar 2022-09-05 21:00:09 +03:00
parent a2192fb984
commit 9b3a3f2e48
11 changed files with 81 additions and 28 deletions

View file

@ -16,7 +16,7 @@ export function specifyStates(
diplomacy: TDiplomacy,
cultures: TCultures,
burgs: TBurgs
): TStates {
): {states: TStates; conflicts: IConflict[]} {
TIME && console.time("specifyStates");
const colors = defineStateColors(statistics);
@ -56,10 +56,8 @@ export function specifyStates(
};
});
const wars = generateConflicts(states); // mutates states
console.log(wars);
console.log(states);
const conflicts = generateConflicts(states, cultures); // mutates states
TIME && console.timeEnd("specifyStates");
return [NEUTRALS, ...states];
return {states: [NEUTRALS, ...states], conflicts};
}