Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SZGenericArrayEnumerator.cs
Go to the documentation of this file.
1
using
System.Collections
;
2
using
System.Collections.Generic
;
3
4
namespace
System
;
5
6
internal
sealed
class
SZGenericArrayEnumerator
<T> :
IEnumerator
<T>,
IDisposable
,
IEnumerator
7
{
8
private
readonly T[]
_array
;
9
10
private
int
_index
;
11
12
internal
static
readonly
SZGenericArrayEnumerator<T>
Empty
=
new
SZGenericArrayEnumerator<T>
(
new
T[0]);
13
14
public
T
Current
15
{
16
get
17
{
18
int
index
=
_index
;
19
T[]
array
=
_array
;
20
if
((uint)
index
>= (uint)
array
.Length)
21
{
22
ThrowHelper
.
ThrowInvalidOperationException_EnumCurrent
(
index
);
23
}
24
return
array
[
index
];
25
}
26
}
27
28
object
IEnumerator.Current =>
Current
;
29
30
internal
SZGenericArrayEnumerator
(T[]
array
)
31
{
32
_array
=
array
;
33
_index
= -1;
34
}
35
36
public
bool
MoveNext
()
37
{
38
int
num =
_index
+ 1;
39
if
((uint)num >= (uint)
_array
.Length)
40
{
41
_index
=
_array
.Length;
42
return
false
;
43
}
44
_index
= num;
45
return
true
;
46
}
47
48
void
IEnumerator
.
Reset
()
49
{
50
_index
= -1;
51
}
52
53
public
void
Dispose
()
54
{
55
}
56
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Empty
Definition
Empty.cs:4
System.SZGenericArrayEnumerator.MoveNext
bool MoveNext()
Definition
SZGenericArrayEnumerator.cs:36
System.SZGenericArrayEnumerator.Dispose
void Dispose()
Definition
SZGenericArrayEnumerator.cs:53
System.SZGenericArrayEnumerator.Current
object IEnumerator. Current
Definition
SZGenericArrayEnumerator.cs:28
System.SZGenericArrayEnumerator.Current
T Current
Definition
SZGenericArrayEnumerator.cs:15
System.SZGenericArrayEnumerator._index
int _index
Definition
SZGenericArrayEnumerator.cs:10
System.SZGenericArrayEnumerator.SZGenericArrayEnumerator
SZGenericArrayEnumerator(T[] array)
Definition
SZGenericArrayEnumerator.cs:30
System.SZGenericArrayEnumerator._array
readonly T[] _array
Definition
SZGenericArrayEnumerator.cs:8
System.SZGenericArrayEnumerator
Definition
SZGenericArrayEnumerator.cs:7
System.ThrowHelper.ThrowInvalidOperationException_EnumCurrent
static void ThrowInvalidOperationException_EnumCurrent(int index)
Definition
ThrowHelper.cs:348
System.ThrowHelper
Definition
ThrowHelper.cs:6
System.Collections.Generic.IEnumerator
Definition
IEnumerator.cs:4
System.Collections.IEnumerator.Reset
void Reset()
System.IDisposable
Definition
IDisposable.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Collections
Definition
BlockingCollection.cs:8
System.ExceptionArgument.index
@ index
System.ExceptionArgument.array
@ array
System
Definition
BlockingCollection.cs:8
source
System.Private.CoreLib
System
SZGenericArrayEnumerator.cs
Generated by
1.10.0