Files
core2026/app/game-engine/src/turn/reservedTurnActionContext.ts
T
Hide_D 4f90f50033 feat: Introduce action context builders for various turn actions
- Added `actionContextBuilder` to multiple turn action files to utilize the default action context builder.
- Implemented specific context builders for actions requiring additional context, such as war configurations, world summaries, and general statistics.
- Created new `actionContext.ts` and `actionContextHelpers.ts` files to define interfaces and helper functions for managing action contexts.
- Enhanced context handling for nation and general actions, ensuring proper data injection for turn execution.
2026-01-03 06:28:50 +00:00

20 lines
576 B
TypeScript

import type {
ActionContextBase,
ActionContextBuilder,
ActionContextOptions,
ActionResolveContext,
} from '@sammo-ts/logic';
export type ActionContextBuilderMap = Map<string, ActionContextBuilder>;
// 커맨드 모듈에서 제공한 컨텍스트 빌더로 확장한다.
export const buildActionContext = (
key: string,
base: ActionContextBase,
options: ActionContextOptions,
builders?: ActionContextBuilderMap
): ActionResolveContext | null => {
const builder = builders?.get(key);
return builder ? builder(base, options) : base;
};