BaseKBehavior

abstract class BaseKBehavior<T, C : KBehaviorContext>(val identifier: KIdentifier) : KBehavior<T, C>

Inheritors

Constructors

Link copied to clipboard
constructor(identifier: KIdentifier)

Properties

Link copied to clipboard
var executor: T.(C) -> Unit?
Link copied to clipboard
open override val identifier: KIdentifier

Unique identifier for a behavior. This identifier is used to uniquely register a behavior within a registry and is composed of the plugin's name and a specific string identifier.

Functions

Link copied to clipboard
open override fun behave(block: T.(context: C) -> Unit)

Sets the behavior logic for a target of type T within a specific context of type C. The behavior logic is provided in the form of a lambda function.

Link copied to clipboard
fun KBehavior<*, *>.register()

Registers this behavior within the global behavior registry.

Link copied to clipboard
open override fun run(target: T, context: C)

Executes the behavior logic for the specified target within the provided context.