20 lines
431 B
C#
20 lines
431 B
C#
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace PkmnLibSharp.Utils
|
||
|
{
|
||
|
internal static class MiscExtensions
|
||
|
{
|
||
|
internal static int IndexOf<T>(this IReadOnlyList<T> list, T element)
|
||
|
{
|
||
|
for (int i = 0; i < list.Count; i++)
|
||
|
{
|
||
|
if (Equals(list[i], element))
|
||
|
{
|
||
|
return i;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return -1;
|
||
|
}
|
||
|
}
|
||
|
}
|