feat: 타입 정의 개선 및 any 사용 제거

This commit is contained in:
2026-01-05 17:19:32 +00:00
parent 7e58f7bac4
commit cb7e9c832f
17 changed files with 176 additions and 86 deletions
+22 -20
View File
@@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest';
import type { City, General, Nation } from '../src/domain/entities.js';
import { resolveGeneralAction } from '../src/actions/engine.js';
import { ActionDefinition } from '../src/actions/turn/general/che_출병.js';
import type { DispatchResolveContext } from '../src/actions/turn/general/che_출병.js';
import type { TurnSchedule } from '../src/turn/calendar.js';
import type { WarAftermathConfig, WarEngineConfig } from '../src/war/types.js';
import type { UnitSetDefinition } from '../src/world/types.js';
@@ -184,28 +185,29 @@ describe('che_출병', () => {
const defender = buildGeneral(2, defenderNation.id, defenderCity.id);
const definition = new ActionDefinition();
const context: Omit<DispatchResolveContext, 'addLog'> = {
general: attacker,
city: attackerCity,
nation: attackerNation,
rng,
destCity: defenderCity,
destNation: defenderNation,
cities: [attackerCity, defenderCity],
nations: [attackerNation, defenderNation],
generals: [attacker, defender],
unitSet,
time: {
year: 200,
month: 1,
startYear: 180,
},
seedBase: 'test-seed',
warConfig,
aftermathConfig,
};
const resolution = resolveGeneralAction(
definition,
{
general: attacker,
city: attackerCity,
nation: attackerNation,
rng,
destCity: defenderCity,
destNation: defenderNation,
cities: [attackerCity, defenderCity],
nations: [attackerNation, defenderNation],
generals: [attacker, defender],
unitSet,
time: {
year: 200,
month: 1,
startYear: 180,
},
seedBase: 'test-seed',
warConfig,
aftermathConfig,
} as any,
context,
{
now: new Date('2000-01-01T00:00:00Z'),
schedule,