feat: port scenario 903 select-pool flow
This commit is contained in:
@@ -5,11 +5,14 @@ import { asNumber, asRecord } from '@sammo-ts/common';
|
||||
import {
|
||||
createIncomeActionContext,
|
||||
DomesticTraitLoader,
|
||||
EventDomesticTraitLoader,
|
||||
isDomesticTraitKey,
|
||||
isEventDomesticTraitKey,
|
||||
isNationTraitKey,
|
||||
isPersonalityTraitKey,
|
||||
isWarTraitKey,
|
||||
loadDomesticTraitModules,
|
||||
loadEventDomesticTraitModules,
|
||||
loadNationTraitModules,
|
||||
loadPersonalityTraitModules,
|
||||
loadWarTraitModules,
|
||||
@@ -301,12 +304,22 @@ export const loadTraitNames = async (keys: Array<string | null>, kind: keyof Tra
|
||||
|
||||
if (kind === 'domestic') {
|
||||
const filtered = missing.filter((key) => isDomesticTraitKey(key));
|
||||
const eventFiltered = missing.filter((key) => isEventDomesticTraitKey(key));
|
||||
if (filtered.length) {
|
||||
const modules = await loadDomesticTraitModules(filtered, new DomesticTraitLoader());
|
||||
for (const module of modules) {
|
||||
cache.set(module.key, { name: module.name, info: module.info ?? '' });
|
||||
}
|
||||
}
|
||||
if (eventFiltered.length) {
|
||||
const modules = await loadEventDomesticTraitModules(
|
||||
eventFiltered,
|
||||
new EventDomesticTraitLoader()
|
||||
);
|
||||
for (const module of modules) {
|
||||
cache.set(module.key, { name: module.name, info: module.info ?? '' });
|
||||
}
|
||||
}
|
||||
} else if (kind === 'war') {
|
||||
const filtered = missing.filter((key) => isWarTraitKey(key));
|
||||
if (filtered.length) {
|
||||
|
||||
Reference in New Issue
Block a user