Skip to content

Class BehaviorTypeRegistry

Namespace: Cephalon.Behaviors.Services
Assembly: Cephalon.Behaviors.dll

Default mutable implementation of . Populated during DI setup by BehaviorCollectionBuilder.Register<TBehavior>() and consumed by at construction time.

public sealed class BehaviorTypeRegistry : IBehaviorTypeRegistry

objectBehaviorTypeRegistry

IBehaviorTypeRegistry

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Initializes a new empty .

public BehaviorTypeRegistry()

Registers a mapping from behaviorId to behaviorType.

public void Register(string behaviorId, Type behaviorType)

behaviorId string

The stable behavior identifier.

behaviorType Type

The concrete behavior implementation type.

Attempts to resolve the concrete behavior type for the given identifier.

public bool TryGetType(string behaviorId, out Type? behaviorType)

behaviorId string

The stable behavior identifier to look up.

behaviorType Type?

When this method returns true, receives the concrete behavior type; otherwise null.

bool

true when the identifier is registered; otherwise false.