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

◆ FindIndex< T >() [1/3]

static int System.Array.FindIndex< T > ( T[] array,
int startIndex,
int count,
Predicate< T > match )
inlinestatic

Definition at line 1689 of file Array.cs.

1690 {
1691 if (array == null)
1692 {
1693 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
1694 }
1696 {
1697 ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_Index();
1698 }
1700 {
1701 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
1702 }
1703 if (match == null)
1704 {
1705 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.match);
1706 }
1707 int num = startIndex + count;
1708 for (int i = startIndex; i < num; i++)
1709 {
1710 if (match(array[i]))
1711 {
1712 return i;
1713 }
1714 }
1715 return -1;
1716 }

References System.array, System.count, System.match, System.startIndex, System.ThrowHelper.ThrowArgumentNullException(), System.ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count(), and System.ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_Index().