Public Member Functions | List of all members
InteractorRepository< TInteractor > Class Template Reference

The default implementation of a IInteractorProvider. More...

Inheritance diagram for InteractorRepository< TInteractor >:
IInteractorRepository< TInteractor >

Public Member Functions

virtual void Add (TInteractor interactor)
 Adds the specified interactor to the repository. More...
 
virtual void Remove (string interactorId)
 Removes the interactor with the specified identifier from the cache. More...
 
bool TryGet (string id, out IInteractor interactor)
 Tries to resolve an interactor using the interactor's identifier. More...
 
void Clear ()
 Clears the repository. More...
 
IEnumerable< TInteractor > Find (Func< TInteractor, bool > predicate)
 Returns all interactors in the repository that match the specified predicate. More...
 

Detailed Description

The default implementation of a IInteractorProvider.

Type Constraints
TInteractor :class 
TInteractor :ICachedBoundsInteractor 

Member Function Documentation

◆ Add()

virtual void Add ( TInteractor  interactor)
inlinevirtual

Adds the specified interactor to the repository.

Parameters
interactorThe interactor to add.
Exceptions
System.ArgumentExceptionTrying to add interactor already in repository.

◆ Remove()

virtual void Remove ( string  interactorId)
inlinevirtual

Removes the interactor with the specified identifier from the cache.

Parameters
interactorIdThe interactor identifier for the interactor to remove.

◆ TryGet()

bool TryGet ( string  id,
out IInteractor  interactor 
)
inline

Tries to resolve an interactor using the interactor's identifier.

Parameters
idThe interactor's identifier.
interactorThe interactor.
Returns
true if the interactor was found; otherwise, false.

◆ Clear()

void Clear ( )
inline

Clears the repository.

◆ Find()

IEnumerable<TInteractor> Find ( Func< TInteractor, bool >  predicate)
inline

Returns all interactors in the repository that match the specified predicate.

Parameters
predicateA function to test each interactor for a condition.
Returns
All interactors matching the predicate.

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