Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LastIndexOf()

override int System.Collections.Generic.ObjectEqualityComparer< T >.LastIndexOf ( T[] array,
T value,
int startIndex,
int count )
inlinepackagevirtual

Reimplemented from System.Collections.Generic.EqualityComparer< T >.

Definition at line 36 of file ObjectEqualityComparer.cs.

37 {
38 int num = startIndex - count + 1;
39 if (value == null)
40 {
41 for (int num2 = startIndex; num2 >= num; num2--)
42 {
43 if (array[num2] == null)
44 {
45 return num2;
46 }
47 }
48 }
49 else
50 {
51 for (int num3 = startIndex; num3 >= num; num3--)
52 {
53 if (array[num3] != null && array[num3].Equals(value))
54 {
55 return num3;
56 }
57 }
58 }
59 return -1;
60 }

References System.array, System.count, System.Collections.Generic.ObjectEqualityComparer< T >.Equals(), System.startIndex, and System.value.