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

◆ Max< TSource >() [4/12]

static double System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource > source,
Func< TSource, double > selector )
inlinestatic

Definition at line 6118 of file Enumerable.cs.

6119 {
6120 if (source == null)
6121 {
6122 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6123 }
6124 if (selector == null)
6125 {
6126 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
6127 }
6128 using IEnumerator<TSource> enumerator = source.GetEnumerator();
6129 if (!enumerator.MoveNext())
6130 {
6131 ThrowHelper.ThrowNoElementsException();
6132 }
6133 double num = selector(enumerator.Current);
6134 while (double.IsNaN(num))
6135 {
6136 if (!enumerator.MoveNext())
6137 {
6138 return num;
6139 }
6140 num = selector(enumerator.Current);
6141 }
6142 while (enumerator.MoveNext())
6143 {
6144 double num2 = selector(enumerator.Current);
6145 if (num2 > num)
6146 {
6147 num = num2;
6148 }
6149 }
6150 return num;
6151 }

References System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.Linq.selector, System.Linq.source, System.Linq.ThrowHelper.ThrowArgumentNullException(), and System.Linq.ThrowHelper.ThrowNoElementsException().