Interface IBehaviorResolver<TContext>
Describes a strategy for resolving behaviors that all accept the same type of context.
Inherited Members
Namespace: SpiceSharp.Entities
Assembly: SpiceSharp.dll
Syntax
public interface IBehaviorResolver<TContext> : IBehaviorResolver where TContext : IBindingContext
Type Parameters
| Name | Description |
|---|---|
| TContext | The type of binding context. |
Methods
RegisterAfter<TBehavior>(Func<TContext, IBehavior>)
Registers a behavior factory for the specified target behavior after any previously defined factories.
Declaration
IBehaviorResolver<TContext> RegisterAfter<TBehavior>(Func<TContext, IBehavior> factory)
where TBehavior : IBehavior
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<TContext, IBehavior> | factory | The factory. |
Returns
| Type | Description |
|---|---|
| IBehaviorResolver<TContext> | The IBehaviorResolver<TContext> for chaining. |
Type Parameters
| Name | Description |
|---|---|
| TBehavior | The target behavior. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
RegisterAfter<TBehavior, TBehaviorImpl>()
Registers a behavior factory for the specified target behavior after any previously defined factories.
Declaration
IBehaviorResolver<TContext> RegisterAfter<TBehavior, TBehaviorImpl>()
where TBehavior : IBehavior where TBehaviorImpl : TBehavior, IBehavior
Returns
| Type | Description |
|---|---|
| IBehaviorResolver<TContext> | The IBehaviorResolver<TContext> for chaining. |
Type Parameters
| Name | Description |
|---|---|
| TBehavior | The target behavior. |
| TBehaviorImpl | The behavior implementation. |
RegisterBefore<TBehavior>(Func<TContext, IBehavior>)
Registers a behavior factory for the specified target behavior before any previously defined factories.
Declaration
IBehaviorResolver<TContext> RegisterBefore<TBehavior>(Func<TContext, IBehavior> factory)
where TBehavior : IBehavior
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<TContext, IBehavior> | factory | The factory. |
Returns
| Type | Description |
|---|---|
| IBehaviorResolver<TContext> | The IBehaviorResolver<TContext> for chaining. |
Type Parameters
| Name | Description |
|---|---|
| TBehavior | The target behavior. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
RegisterBefore<TBehavior, TBehaviorImpl>()
Registers a behavior factory for the specified target behavior before any previously defined factories.
Declaration
IBehaviorResolver<TContext> RegisterBefore<TBehavior, TBehaviorImpl>()
where TBehavior : IBehavior where TBehaviorImpl : TBehavior, IBehavior
Returns
| Type | Description |
|---|---|
| IBehaviorResolver<TContext> | The IBehaviorResolver<TContext> for chaining. |
Type Parameters
| Name | Description |
|---|---|
| TBehavior | The target behavior. |
| TBehaviorImpl | The behavior implementation. |
Resolve(ISimulation, IBehaviorContainer, TContext)
Resolves behaviors in the container for the specified simulation and context.
Declaration
void Resolve(ISimulation simulation, IBehaviorContainer container, TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| ISimulation | simulation | The simulation. |
| IBehaviorContainer | container | The container. |
| TContext | context | The context. |