내무부, 금/쌀수입, 감찰부 구현
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import type { TurnCalendarHandler } from './inMemoryWorld.js';
|
||||
|
||||
export const composeCalendarHandlers = (
|
||||
...handlers: Array<TurnCalendarHandler | null | undefined>
|
||||
): TurnCalendarHandler | null => {
|
||||
const resolved = handlers.filter(Boolean) as TurnCalendarHandler[];
|
||||
if (resolved.length === 0) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
onMonthChanged: (context) => {
|
||||
for (const handler of resolved) {
|
||||
handler.onMonthChanged?.(context);
|
||||
}
|
||||
},
|
||||
onYearChanged: (context) => {
|
||||
for (const handler of resolved) {
|
||||
handler.onYearChanged?.(context);
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user