register

fun <T, C : KBehaviorContext> register(behavior: KBehavior<T, C>)

Registers a new behavior into the behavior registry. If a behavior with the same identifier already exists, it will be overwritten with the new behavior.

Parameters

T

The type of the target this behavior is applied to.

C

The type of the context in which this behavior operates. Must implement KBehaviorContext.

behavior

The behavior to be registered. Contains the identifier and the logic to be associated with the specified target and context.