feat: implement monthly city supply update
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user