Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ArrayEnumerator.cs
Go to the documentation of this file.
1
using
System.Collections
;
2
3
namespace
System
;
4
5
internal
sealed
class
ArrayEnumerator
:
IEnumerator
,
ICloneable
6
{
7
private
readonly
Array
_array
;
8
9
private
nint
_index
;
10
11
public
object
Current
12
{
13
get
14
{
15
nint
index
=
_index
;
16
Array
array
=
_array
;
17
if
((nuint)
index
>=
array
.NativeLength)
18
{
19
if
(
index
< 0)
20
{
21
ThrowHelper
.
ThrowInvalidOperationException_InvalidOperation_EnumNotStarted
();
22
}
23
else
24
{
25
ThrowHelper
.
ThrowInvalidOperationException_InvalidOperation_EnumEnded
();
26
}
27
}
28
return
array
.InternalGetValue(
index
);
29
}
30
}
31
32
internal
ArrayEnumerator
(
Array
array
)
33
{
34
_array
=
array
;
35
_index
= -1;
36
}
37
38
public
object
Clone
()
39
{
40
return
MemberwiseClone();
41
}
42
43
public
bool
MoveNext
()
44
{
45
nint num =
_index
+ 1;
46
if
((nuint)num >=
_array
.
NativeLength
)
47
{
48
_index
= (nint)
_array
.
NativeLength
;
49
return
false
;
50
}
51
_index
= num;
52
return
true
;
53
}
54
55
public
void
Reset
()
56
{
57
_index
= -1;
58
}
59
}
System.ArrayEnumerator._array
readonly Array _array
Definition
ArrayEnumerator.cs:7
System.ArrayEnumerator._index
nint _index
Definition
ArrayEnumerator.cs:9
System.ArrayEnumerator.Reset
void Reset()
Definition
ArrayEnumerator.cs:55
System.ArrayEnumerator.Clone
object Clone()
Definition
ArrayEnumerator.cs:38
System.ArrayEnumerator.ArrayEnumerator
ArrayEnumerator(Array array)
Definition
ArrayEnumerator.cs:32
System.ArrayEnumerator.Current
object Current
Definition
ArrayEnumerator.cs:12
System.ArrayEnumerator.MoveNext
bool MoveNext()
Definition
ArrayEnumerator.cs:43
System.ArrayEnumerator
Definition
ArrayEnumerator.cs:6
System.Array.NativeLength
nuint NativeLength
Definition
Array.cs:432
System.Array
Definition
Array.cs:16
System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumEnded
static void ThrowInvalidOperationException_InvalidOperation_EnumEnded()
Definition
ThrowHelper.cs:342
System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumNotStarted
static void ThrowInvalidOperationException_InvalidOperation_EnumNotStarted()
Definition
ThrowHelper.cs:336
System.ThrowHelper
Definition
ThrowHelper.cs:6
System.Collections.IEnumerator
Definition
IEnumerator.cs:4
System.ICloneable
Definition
ICloneable.cs:4
System.Collections
Definition
BlockingCollection.cs:8
System.ExceptionArgument.index
@ index
System.ExceptionArgument.array
@ array
System
Definition
BlockingCollection.cs:8
source
System.Private.CoreLib
System
ArrayEnumerator.cs
Generated by
1.10.0