KBehaviorRegistry

A registry for managing and storing KBehavior instances, allowing them to be registered and retrieved by their unique identifiers.

This singleton provides mechanisms for adding new behaviors into the registry and fetching them dynamically at runtime using a unique string identifier.

Functions

Link copied to clipboard

Retrieves a registered behavior of the specified type and context by its identifier.

Link copied to clipboard
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.