Static Public Member Functions | List of all members
InteractorExtensions Class Reference

Contains extensions for IInteractor. More...

Static Public Member Functions

static TBehavior GetBehavior< TBehavior > (this IInteractor interactor)
 Gets a behavior from the specified interactor. More...
 
static IBehavior GetBehavior (this IInteractor interactor, Framework.BehaviorType type)
 Gets a behavior from the specified interactor. More...
 
static GazeAwareBehavior WithGazeAware (this IMutableBehaviorsInteractor interactor)
 Gets a GazeAwareBehavior for the specified interactor. The behavior will be created and added if it do not already exist. More...
 
static IEnumerable< GazeAwareBehaviorWithGazeAware (this IEnumerable< IMutableBehaviorsInteractor > interactors)
 Gets an iterator to a sequence of GazeAwareBehavior for the specified interactors. The behaviors will be created and added if they does not already exist. More...
 
static TInteractor WithGazeAware< TInteractor > (this TInteractor interactor, Action< GazeAwareBehavior > action)
 Adds a GazeAwareBehavior on the specified interactor if it is not present, and configures it using the specified action . More...
 
static IEnumerable< TInteractor > WithGazeAware< TInteractor > (this IEnumerable< TInteractor > interactors, Action< GazeAwareBehavior > action)
 Adds a GazeAwareBehavior on all the specified interactors if it is not present, and configures them using the specified action . More...
 
static IEnumerable< TBehavior > GetOrAdd< TBehavior > (this IEnumerable< IMutableBehaviorsInteractor > interactors)
 Gets a specific behavior from a sequence of interactors. The behaviors will be created and added if they do not already exist on the interactor. More...
 
static TInteractor GetOrAdd< TInteractor, TBehavior > (this TInteractor interactor, Action< TBehavior > action)
 Gets a specific behavior from an interactor and configures it using the specified action. The behavior will be created and added if it do not already exist on the interactor. More...
 
static IEnumerable< TInteractor > GetOrAdd< TInteractor, TBehavior > (this IEnumerable< TInteractor > interactors, Action< TBehavior > action)
 Gets a specific behavior from a sequence of interactors and configures it using the specified action. The behaviors will be created and added if they do not already exist on the interactor. More...
 

Detailed Description

Contains extensions for IInteractor.

Member Function Documentation

◆ GetBehavior< TBehavior >()

static TBehavior GetBehavior< TBehavior > ( this IInteractor  interactor)
inlinestatic

Gets a behavior from the specified interactor.

Template Parameters
TBehaviorThe behavior type.
Parameters
interactorThe interactor.
Returns
A behavior or null if not found.
Type Constraints
TBehavior :class 
TBehavior :IBehavior 

◆ GetBehavior()

static IBehavior GetBehavior ( this IInteractor  interactor,
Framework.BehaviorType  type 
)
inlinestatic

Gets a behavior from the specified interactor.

Parameters
interactorThe interactor.
typeThe behavior type.
Returns
A behavior or null if not found.

◆ WithGazeAware() [1/2]

static GazeAwareBehavior WithGazeAware ( this IMutableBehaviorsInteractor  interactor)
inlinestatic

Gets a GazeAwareBehavior for the specified interactor. The behavior will be created and added if it do not already exist.

Parameters
interactorThe interactor.
Returns
A gaze aware behavior.

◆ WithGazeAware() [2/2]

static IEnumerable<GazeAwareBehavior> WithGazeAware ( this IEnumerable< IMutableBehaviorsInteractor interactors)
inlinestatic

Gets an iterator to a sequence of GazeAwareBehavior for the specified interactors. The behaviors will be created and added if they does not already exist.

Parameters
interactorsThe interactors.
Returns
An iterator to a sequence of gaze aware behaviors.

◆ WithGazeAware< TInteractor >() [1/2]

static TInteractor WithGazeAware< TInteractor > ( this TInteractor  interactor,
Action< GazeAwareBehavior action 
)
inlinestatic

Adds a GazeAwareBehavior on the specified interactor if it is not present, and configures it using the specified action .

Template Parameters
TInteractorAn interactor of type IMutableBehaviorsInteractor.
Parameters
interactorThe interactor.
actionThe action to configure the GazeAwareBehavior with.
Returns
The interactor.
Type Constraints
TInteractor :IMutableBehaviorsInteractor 

◆ WithGazeAware< TInteractor >() [2/2]

static IEnumerable<TInteractor> WithGazeAware< TInteractor > ( this IEnumerable< TInteractor >  interactors,
Action< GazeAwareBehavior action 
)
inlinestatic

Adds a GazeAwareBehavior on all the specified interactors if it is not present, and configures them using the specified action .

Template Parameters
TInteractorAn interactor of type IMutableBehaviorsInteractor.
Parameters
interactorsThe interactors.
actionThe action to configure the GazeAwareBehaviors with.
Returns
The interactors.
Type Constraints
TInteractor :IMutableBehaviorsInteractor 

◆ GetOrAdd< TBehavior >()

static IEnumerable<TBehavior> GetOrAdd< TBehavior > ( this IEnumerable< IMutableBehaviorsInteractor interactors)
inlinestatic

Gets a specific behavior from a sequence of interactors. The behaviors will be created and added if they do not already exist on the interactor.

Template Parameters
TBehaviorThe behavior type.
Parameters
interactorsThe interactors.
Returns
A sequence of behaviors.
Type Constraints
TBehavior :class 
TBehavior :IBehavior 
TBehavior :new() 

◆ GetOrAdd< TInteractor, TBehavior >() [1/2]

static TInteractor GetOrAdd< TInteractor, TBehavior > ( this TInteractor  interactor,
Action< TBehavior >  action 
)
inlinestatic

Gets a specific behavior from an interactor and configures it using the specified action. The behavior will be created and added if it do not already exist on the interactor.

Template Parameters
TInteractorThe interactor type.
TBehaviorThe behavior type.
Parameters
interactorThe interactor.
actionThe action used to configure the behavior.
Returns
The same TInteractor instance so that multiple calls can be chained.
Type Constraints
TInteractor :IMutableBehaviorsInteractor 
TBehavior :class 
TBehavior :IBehavior 
TBehavior :new() 

◆ GetOrAdd< TInteractor, TBehavior >() [2/2]

static IEnumerable<TInteractor> GetOrAdd< TInteractor, TBehavior > ( this IEnumerable< TInteractor >  interactors,
Action< TBehavior >  action 
)
inlinestatic

Gets a specific behavior from a sequence of interactors and configures it using the specified action. The behaviors will be created and added if they do not already exist on the interactor.

Template Parameters
TInteractorThe interactor type.
TBehaviorThe behavior type.
Parameters
interactorsThe interactors.
actionThe action used to configure the behaviors.
Returns
The same IEnumerable<TInteractor> instance so that multiple calls can be chained.
Type Constraints
TInteractor :IMutableBehaviorsInteractor 
TBehavior :class 
TBehavior :IBehavior 
TBehavior :new() 

The documentation for this class was generated from the following file: