Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Iterator.cs
Go to the documentation of this file.
3
4namespace System.IO;
5
6internal abstract class Iterator<TSource> : IEnumerable<TSource>, IEnumerable, IEnumerator<TSource>, IDisposable, IEnumerator
7{
8 private readonly int _threadId;
9
10 internal int state;
11
12 internal TSource current;
13
14 public TSource Current => current;
15
16 object IEnumerator.Current => Current;
17
22
23 protected abstract Iterator<TSource> Clone();
24
25 public void Dispose()
26 {
27 Dispose(disposing: true);
28 GC.SuppressFinalize(this);
29 }
30
31 protected virtual void Dispose(bool disposing)
32 {
33 current = default(TSource);
34 state = -1;
35 }
36
38 {
40 {
41 state = 1;
42 return this;
43 }
45 iterator.state = 1;
46 return iterator;
47 }
48
49 public abstract bool MoveNext();
50
55
57 {
58 throw new NotSupportedException();
59 }
60}
static int CurrentManagedThreadId
static void SuppressFinalize(object obj)
Definition GC.cs:202
Definition GC.cs:8
IEnumerator< TSource > GetEnumerator()
Definition Iterator.cs:37
readonly int _threadId
Definition Iterator.cs:8
object IEnumerator. Current
Definition Iterator.cs:16
Iterator< TSource > Clone()
virtual void Dispose(bool disposing)
Definition Iterator.cs:31
new IEnumerator< T > GetEnumerator()