BattleSessionActionExecutionSupport

class BattleSessionActionExecutionSupport(effectExecutionCoordinator: BattleSessionEffectExecutionCoordinator = BattleSessionEffectExecutionCoordinator(), directDamageApplier: BattleSessionDirectDamageApplier = BattleSessionDirectDamageApplier(), switchActionExecutor: BattleSessionSwitchActionExecutor = BattleSessionSwitchActionExecutor(), runActionExecutor: BattleSessionRunActionExecutor = BattleSessionRunActionExecutor())

session action 执行辅助组件。

设计意图:

  • 作为 session action 执行相关 helper 的稳定门面;

  • 对外继续维持一个 Bean/构造入口,避免 Spring 配置和测试装配反复跟着改签名;

  • 具体职责拆给独立的小组件,让代码按“一个执行职责一个文件”继续收口。

Constructors

Link copied to clipboard
constructor(effectExecutionCoordinator: BattleSessionEffectExecutionCoordinator = BattleSessionEffectExecutionCoordinator(), directDamageApplier: BattleSessionDirectDamageApplier = BattleSessionDirectDamageApplier(), switchActionExecutor: BattleSessionSwitchActionExecutor = BattleSessionSwitchActionExecutor(), runActionExecutor: BattleSessionRunActionExecutor = BattleSessionRunActionExecutor())

Functions

Link copied to clipboard
fun applyDirectDamage(session: BattleSession, sourceId: String, targetId: String, damage: Int): BattleRuntimeSnapshot

将直接伤害 mutation 应用到当前快照。

Link copied to clipboard

执行逃跑动作。

Link copied to clipboard

执行 switch 动作并更新当前 active 列表。

Link copied to clipboard
fun executeResolvedEffect(session: BattleSession, effectId: String, actorUnitId: String, targetUnitId: String, accuracy: Int?, evasion: Int?, basePower: Int, damage: Int, attributes: Map<String, Any?>): MoveResolutionResult

执行一个已经具备目标信息的 effect。

Link copied to clipboard
fun recordMoveExecution(session: BattleSession, moveId: String, attackerId: String, targetId: String, result: MoveResolutionResult)

记录一次 move 或 item 的最终结算结果。