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

◆ LastIndexOf() [3/6]

override int System.Collections.ArrayList.IListWrapper.LastIndexOf ( object value,
int startIndex,
int count )
inline

Definition at line 360 of file ArrayList.cs.

361 {
362 if (_list.Count == 0)
363 {
364 return -1;
365 }
366 if (startIndex < 0 || startIndex >= _list.Count)
367 {
368 throw new ArgumentOutOfRangeException("startIndex", SR.ArgumentOutOfRange_Index);
369 }
370 if (count < 0 || count > startIndex + 1)
371 {
372 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_Count);
373 }
374 int num = startIndex - count + 1;
375 if (value == null)
376 {
377 for (int num2 = startIndex; num2 >= num; num2--)
378 {
379 if (_list[num2] == null)
380 {
381 return num2;
382 }
383 }
384 return -1;
385 }
386 for (int num3 = startIndex; num3 >= num; num3--)
387 {
388 object obj = _list[num3];
389 if (obj != null && obj.Equals(value))
390 {
391 return num3;
392 }
393 }
394 return -1;
395 }

References System.Collections.ArrayList.IListWrapper._list, System.SR.ArgumentOutOfRange_Count, System.SR.ArgumentOutOfRange_Index, System.count, System.Collections.ICollection.Count, System.obj, System.startIndex, and System.value.