Implement nation betting lifecycle
This commit is contained in:
@@ -61,6 +61,10 @@ import {
|
||||
} from './monthlyInvaderAction.js';
|
||||
import { createChangeCityHandler } from './monthlyChangeCityAction.js';
|
||||
import { createProvideNpcTroopLeaderHandler } from './monthlyProvideNpcTroopLeaderAction.js';
|
||||
import {
|
||||
createFinishNationBettingHandler,
|
||||
createOpenNationBettingHandler,
|
||||
} from './monthlyNationBettingAction.js';
|
||||
import { buildCommandEnv } from './reservedTurnCommands.js';
|
||||
import { DatabaseTurnDaemonLease, TurnDaemonLeaseUnavailableError } from '../lifecycle/databaseTurnDaemonLease.js';
|
||||
|
||||
@@ -332,6 +336,18 @@ const createTurnDaemonRuntimeWithLease = async (
|
||||
getWorld: () => worldRef,
|
||||
})
|
||||
);
|
||||
eventActions.set(
|
||||
'OpenNationBetting',
|
||||
createOpenNationBettingHandler({
|
||||
getWorld: () => worldRef,
|
||||
})
|
||||
);
|
||||
eventActions.set(
|
||||
'FinishNationBetting',
|
||||
createFinishNationBettingHandler({
|
||||
getWorld: () => worldRef,
|
||||
})
|
||||
);
|
||||
eventActions.set('ProcessIncome', async (_args, environment) => {
|
||||
await incomeHandler.onMonthChanged?.({
|
||||
previousYear: environment.month === 1 ? environment.year - 1 : environment.year,
|
||||
|
||||
Reference in New Issue
Block a user