feat: implement monthly city supply update

This commit is contained in:
2026-07-25 16:58:19 +00:00
parent 036e72b929
commit 3142f8d917
7 changed files with 801 additions and 3 deletions
+8
View File
@@ -46,6 +46,7 @@ import {
type MonthlyEventActionHandler,
} from './monthlyEventHandler.js';
import { createRaiseDisasterHandler } from './monthlyDisasterAction.js';
import { createUpdateCitySupplyHandler } from './monthlyCitySupplyAction.js';
import { DatabaseTurnDaemonLease, TurnDaemonLeaseUnavailableError } from '../lifecycle/databaseTurnDaemonLease.js';
export interface TurnDaemonRuntimeOptions {
@@ -167,6 +168,13 @@ const createTurnDaemonRuntimeWithLease = async (
generalActionModules: monthlyActionModules.general,
})
);
eventActions.set(
'UpdateCitySupply',
createUpdateCitySupplyHandler({
getWorld: () => worldRef,
map: snapshot.map,
})
);
eventActions.set('ProcessIncome', (_args, environment) => {
void incomeHandler.onMonthChanged?.({
previousYear: environment.month === 1 ? environment.year - 1 : environment.year,