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

◆ IndexOf()

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

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

Definition at line 10 of file ObjectEqualityComparer.cs.

11 {
12 int num = startIndex + count;
13 if (value == null)
14 {
15 for (int i = startIndex; i < num; i++)
16 {
17 if (array[i] == null)
18 {
19 return i;
20 }
21 }
22 }
23 else
24 {
25 for (int j = startIndex; j < num; j++)
26 {
27 if (array[j] != null && array[j].Equals(value))
28 {
29 return j;
30 }
31 }
32 }
33 return -1;
34 }

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