ClearWeatherActionExecutor.kt
package io.github.lishangbu.avalon.game.battle.engine.core.runtime.action
import io.github.lishangbu.avalon.game.battle.engine.core.dsl.ActionNode
import io.github.lishangbu.avalon.game.battle.engine.core.dsl.action.ClearWeatherActionNode
import io.github.lishangbu.avalon.game.battle.engine.core.event.EventContext
import io.github.lishangbu.avalon.game.battle.engine.core.mutation.ClearWeatherMutation
import io.github.lishangbu.avalon.game.battle.engine.core.runtime.ActionExecutor
import io.github.lishangbu.avalon.game.battle.engine.core.runtime.ActionResult
import io.github.lishangbu.avalon.game.battle.engine.core.type.ActionTypeId
import io.github.lishangbu.avalon.game.battle.engine.core.type.StandardActionTypeIds
/**
* `clear_weather` 动作执行器。
*/
class ClearWeatherActionExecutor : ActionExecutor {
override val type: ActionTypeId = StandardActionTypeIds.CLEAR_WEATHER
override fun execute(
action: ActionNode,
context: EventContext,
): ActionResult {
require(action is ClearWeatherActionNode) { "Action must be ClearWeatherActionNode." }
return ActionResult(
mutations = listOf(ClearWeatherMutation()),
)
}
}