시나리오 기본 시작 연도와 출병 제한 기준 통일

This commit is contained in:
2026-09-17 00:53:24 +00:00
parent 581ecd6a7b
commit d89bdc439f
16 changed files with 393 additions and 34 deletions
+24
View File
@@ -102,6 +102,30 @@ const buildNation = (): NationRow =>
}) as unknown as NationRow;
describe('buildTurnCommandTable', () => {
it.each([null, 180, 189, 2025, 0])(
'uses the resolved calendar for sortie reservation when startYear=%s',
async (startYear) => {
const base = startYear ?? 180;
for (const offset of [0, 1, 2, 3]) {
const worldState = buildWorldState('full');
worldState.currentYear = base + offset;
worldState.meta = { scenarioMeta: { startYear } };
const general = buildGeneral();
general.rice = 10000;
const table = await buildTurnCommandTable({
worldState,
general,
city: buildCity(),
nation: buildNation(),
nationGenerals: [],
});
const sortie = table.general.flatMap(({ values }) => values).find(({ key }) => key === 'che_출병');
expect(sortie).toBeDefined();
expect(sortie?.status === 'blocked').toBe(offset === 0);
}
}
);
const findCommand = (table: Awaited<ReturnType<typeof buildTurnCommandTable>>, key: string) =>
[...table.general, ...table.nation].flatMap(({ values }) => values).find((command) => command.key === key);