feat(engine): migrate monthly pre-update boundary

This commit is contained in:
2026-07-25 21:36:34 +00:00
parent bd57a99d0e
commit 5f390a46b9
12 changed files with 666 additions and 59 deletions
+10 -2
View File
@@ -26,6 +26,7 @@ import { createGatewayProfileGate } from './gatewayProfileGate.js';
import { composeCalendarHandlers } from './calendarHandlers.js';
import { createIncomeHandler } from './incomeHandler.js';
import { createNationTurnMonthlyHandler } from './nationTurnMonthlyHandler.js';
import { createMonthlyBoundaryPreHandler } from './monthlyBoundaryPreHandler.js';
import { createFrontStateHandler } from './frontStateHandler.js';
import { createReservedTurnHandler } from './reservedTurnHandler.js';
import { createReservedTurnStore } from './reservedTurnStore.js';
@@ -443,6 +444,11 @@ const createTurnDaemonRuntimeWithLease = async (
const nationTurnMonthlyHandler = createNationTurnMonthlyHandler({
getWorld: () => worldRef,
});
const monthlyBoundaryPreHandler = createMonthlyBoundaryPreHandler({
getWorld: () => worldRef,
startYear: snapshot.scenarioMeta?.startYear ?? state.currentYear,
commandEnv: monthlyCommandEnv,
});
const frontStateHandler = createFrontStateHandler({
getWorld: () => worldRef,
map: snapshot.map ?? null,
@@ -467,13 +473,14 @@ const createTurnDaemonRuntimeWithLease = async (
});
const calendarHandler = composeCalendarHandlers(
monthlyEventHandler,
yearbookHandler.handler,
options.calendarHandler ?? unification?.handler,
monthlyBoundaryPreHandler,
nationTurnMonthlyHandler,
hasEventAction('ProcessIncome') ? null : incomeHandler,
frontStateHandler,
neutralAuctionRegistrar.handler,
tournamentAutoStartHandler,
yearbookHandler.handler
tournamentAutoStartHandler
);
const worldOptions: InMemoryTurnWorldOptions = {
schedule,
@@ -487,6 +494,7 @@ const createTurnDaemonRuntimeWithLease = async (
unitSet: snapshot.unitSet,
getWorld: () => worldRef,
commandProfile,
commandEnv: monthlyCommandEnv,
})),
calendarHandler: calendarHandler ?? undefined,
};