Struct ReadOnlyListCastEnumerator<TBase, TItem>
A structure similar to ListCastEnumerator<TBase, TItem>, but for IReadOnlyList<T>. It is not quite as fast as ListCastEnumerator<TBase, TItem>, but is still faster than using the typical Enumerable implementation for IReadOnlyList. You should only use this if you can't use ListCastEnumerator<TBase, TItem> due to the type you're working with; they share the same characteristics otherwise.
All objects must be of the specified type, or the iterator will not function.
Inherited Members
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public struct ReadOnlyListCastEnumerator<TBase, TItem> : IEnumerator<TItem>, IEnumerator, IDisposable, IEnumerable<TItem>, IEnumerable where TItem : TBase
Type Parameters
Name | Description |
---|---|
TBase | Type items in the list are stored as. |
TItem | Actual type of items in the list. |
Constructors
View SourceReadOnlyListCastEnumerator(IReadOnlyList<TBase>)
Constructor.
Declaration
public ReadOnlyListCastEnumerator(IReadOnlyList<TBase> list)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<TBase> | list | List to iterate over. |
Properties
View SourceCurrent
Declaration
public TItem Current { get; }
Property Value
Type | Description |
---|---|
TItem |
Methods
View SourceDispose()
Declaration
public void Dispose()
GetEnumerator()
Returns this enumerator.
Declaration
public ReadOnlyListCastEnumerator<TBase, TItem> GetEnumerator()
Returns
Type | Description |
---|---|
ReadOnlyListCastEnumerator<TBase, TItem> | This enumerator. |
MoveNext()
Declaration
public bool MoveNext()
Returns
Type | Description |
---|---|
bool |