Show / Hide Table of Contents

Class BehaviorList<T>

Class representing an ordered list of behaviors.

Inheritance
object
BehaviorList<T>
Implements
IEnumerable<T>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 behaviors is null.

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

IEnumerable<T>
IEnumerable

Extension Methods

Utility.ThrowIfNull<T>(T, string)
Utility.ThrowIfEmpty<T>(IEnumerable<T>, string)

See Also

IEnumerable<T>
In this article
Back to top Generated by DocFX