feat: add 화계 (Fire Attack) action for generals

- Implemented the 화계 action in the general turn actions, allowing generals to perform sabotage on enemy cities.
- Created CommandResolver and ActionResolver classes to handle the logic and resolution of the action.
- Added necessary constraints to ensure valid conditions for executing the action, including checks for city occupation and resource requirements.
- Updated the general action index to include the new 화계 action.
- Introduced evaluation functions for constraints to manage action prerequisites effectively.
- Enhanced logging for successful and failed attempts of the 화계 action, providing detailed feedback on outcomes.
This commit is contained in:
2025-12-29 09:38:32 +00:00
parent 27cc016804
commit ee719df8fe
16 changed files with 1301 additions and 66 deletions
+18
View File
@@ -0,0 +1,18 @@
import type { Constraint, ConstraintContext } from '../constraints/types.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from './engine.js';
import type { GeneralTriggerState } from '../domain/entities.js';
export interface GeneralActionDefinition<
TriggerState extends GeneralTriggerState = GeneralTriggerState,
Args = unknown,
Context extends GeneralActionResolveContext<TriggerState> = GeneralActionResolveContext<TriggerState>
> {
key: string;
name: string;
parseArgs(raw: unknown): Args | null;
buildConstraints(ctx: ConstraintContext, args: Args): Constraint[];
resolve(context: Context, args: Args): GeneralActionOutcome<TriggerState>;
}