Show / Hide Table of Contents

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.

Implements
IEnumerator<TItem>
IEnumerator
IDisposable
IEnumerable<TItem>
IEnumerable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
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 Source

ReadOnlyListCastEnumerator(IReadOnlyList<TBase>)

Constructor.

Declaration
public ReadOnlyListCastEnumerator(IReadOnlyList<TBase> list)
Parameters
Type Name Description
IReadOnlyList<TBase> list

List to iterate over.

Properties

View Source

Current

Declaration
public TItem Current { get; }
Property Value
Type Description
TItem

Methods

View Source

Dispose()

Declaration
public void Dispose()
View Source

GetEnumerator()

Returns this enumerator.

Declaration
public ReadOnlyListCastEnumerator<TBase, TItem> GetEnumerator()
Returns
Type Description
ReadOnlyListCastEnumerator<TBase, TItem>

This enumerator.

View Source

MoveNext()

Declaration
public bool MoveNext()
Returns
Type Description
bool

Implements

IEnumerator<T>
IEnumerator
IDisposable
IEnumerable<T>
IEnumerable

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX