Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CharEnumerator.cs
Go to the documentation of this file.
3
4namespace System;
5
7{
8 private string _str;
9
10 private int _index;
11
12 private char _currentElement;
13
14 object? IEnumerator.Current => Current;
15
16 public char Current
17 {
18 get
19 {
20 if (_index == -1)
21 {
23 }
24 if (_index >= _str.Length)
25 {
27 }
28 return _currentElement;
29 }
30 }
31
32 internal CharEnumerator(string str)
33 {
34 _str = str;
35 _index = -1;
36 }
37
38 public object Clone()
39 {
40 return MemberwiseClone();
41 }
42
43 public bool MoveNext()
44 {
45 if (_index < _str.Length - 1)
46 {
47 _index++;
49 return true;
50 }
51 _index = _str.Length;
52 return false;
53 }
54
55 public void Dispose()
56 {
57 if (_str != null)
58 {
59 _index = _str.Length;
60 }
61 _str = null;
62 }
63
64 public void Reset()
65 {
66 _currentElement = '\0';
67 _index = -1;
68 }
69}
object? IEnumerator. Current
static string InvalidOperation_EnumNotStarted
Definition SR.cs:46
static string InvalidOperation_EnumEnded
Definition SR.cs:42
Definition SR.cs:7