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.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { GeneralActionDefinition } from '../definition.js';
|
||||
import type { GeneralActionResolver } from '../engine.js';
|
||||
import type { ActionContextBuilder } from './actionContext.js';
|
||||
import type { TurnCommandEnv } from './commandEnv.js';
|
||||
|
||||
export interface TurnCommandSpecBase<TKey extends string = string> {
|
||||
@@ -15,4 +16,5 @@ export interface TurnCommandModule<TSpec extends TurnCommandSpecBase = TurnComma
|
||||
ActionDefinition: new (...args: any[]) => GeneralActionDefinition;
|
||||
ActionResolver?: new (...args: any[]) => GeneralActionResolver;
|
||||
CommandResolver?: new (...args: any[]) => unknown;
|
||||
actionContextBuilder?: ActionContextBuilder;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user