AnyConditionInterpreter.kt
package io.github.lishangbu.avalon.game.battle.engine.core.runtime.condition
import io.github.lishangbu.avalon.game.battle.engine.core.dsl.ConditionNode
import io.github.lishangbu.avalon.game.battle.engine.core.dsl.condition.AnyConditionNode
import io.github.lishangbu.avalon.game.battle.engine.core.event.EventContext
import io.github.lishangbu.avalon.game.battle.engine.core.runtime.ConditionInterpreter
import io.github.lishangbu.avalon.game.battle.engine.core.type.ConditionTypeId
import io.github.lishangbu.avalon.game.battle.engine.core.type.StandardConditionTypeIds
/**
* `any` 条件解释器。
*/
class AnyConditionInterpreter : ConditionInterpreter {
override val type: ConditionTypeId = StandardConditionTypeIds.ANY
override fun evaluate(
condition: ConditionNode,
context: EventContext,
): Boolean {
require(condition is AnyConditionNode) { "Condition must be AnyConditionNode." }
error("AnyConditionInterpreter requires HookRuleProcessor-level recursion support.")
}
}