Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EnumerableExtensions.cs
Go to the documentation of this file.
3
5
6internal static class EnumerableExtensions
7{
9 {
11 while (enumerator.MoveNext())
12 {
13 T current = enumerator.Current;
14 if (predicate(current))
15 {
16 return current;
17 }
18 }
19 return default(T);
20 }
21
23 {
24 foreach (TSource item in source)
25 {
26 yield return selector(item);
27 }
28 }
29
30 public static T Last<T>(this ImmutableArray<T>.Builder source)
31 {
32 return source[source.Count - 1];
33 }
34
36 {
39 int[] array = new int[source2.Count];
40 for (int i = 0; i < array.Length; i++)
41 {
42 array[i] = i;
43 }
44 Array.Sort(array, delegate(int left, int right)
45 {
46 if (left == right)
47 {
48 return 0;
49 }
50 int num = comparison2(source2[left], source2[right]);
51 return (num == 0) ? (left - right) : num;
52 });
53 int[] array2 = array;
54 foreach (int index in array2)
55 {
56 yield return source2[index];
57 }
58 }
59}
static void Sort(Array array)
Definition Array.cs:2329
static ? T FirstOrDefault< T >(this ImmutableArray< T > collection, Func< T, bool > predicate)
static T Last< T >(this ImmutableArray< T >.Builder source)
static IEnumerable< TResult > Select< TSource, TResult >(this IEnumerable< TSource > source, Func< TSource, TResult > selector)
static IEnumerable< T > OrderBy< T >(this List< T > source, Comparison< T > comparison)