Class BehaviorList<T>
Class representing an ordered list of behaviors.
Inherited Members
Namespace: SpiceSharp.Behaviors
Assembly: SpiceSharp.dll
Syntax
public class BehaviorList<T> : IEnumerable<T>, IEnumerable where T : IBehavior
Type Parameters
| Name | Description |
|---|---|
| T | The base behavior type. |
Constructors
BehaviorList(IEnumerable<T>)
Initializes a new instance of the BehaviorList<T> class.
Declaration
public BehaviorList(IEnumerable<T> behaviors)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | behaviors | An enumeration of all behaviors that need to be added. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
Properties
Count
Gets the number of behaviors in the list.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int | The number of behaviors in the list. |
this[int]
Gets the behavior at the specified index.
Declaration
public T this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index. |
Property Value
| Type | Description |
|---|---|
| T | The behavior at the specified index. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if the index exceeds the bounds of the list. |
Methods
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<T> | An enumerator that can be used to iterate through the collection. |
Implements
Extension Methods
See Also
IEnumerable<T>