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

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

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

Definition at line 1756 of file Array.cs.

1757 {
1758 if (array == null)
1759 {
1760 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
1761 }
1762 if (match == null)
1763 {
1764 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.match);
1765 }
1766 if (array.Length == 0)
1767 {
1768 if (startIndex != -1)
1769 {
1770 ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_Index();
1771 }
1772 }
1773 else if (startIndex < 0 || startIndex >= array.Length)
1774 {
1775 ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_Index();
1776 }
1777 if (count < 0 || startIndex - count + 1 < 0)
1778 {
1779 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
1780 }
1781 int num = startIndex - count;
1782 for (int num2 = startIndex; num2 > num; num2--)
1783 {
1784 if (match(array[num2]))
1785 {
1786 return num2;
1787 }
1788 }
1789 return -1;
1790 }

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