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

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

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

Definition at line 6035 of file Enumerable.cs.

6036 {
6037 if (source == null)
6038 {
6039 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6040 }
6041 if (selector == null)
6042 {
6043 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
6044 }
6045 using IEnumerator<TSource> enumerator = source.GetEnumerator();
6046 if (!enumerator.MoveNext())
6047 {
6048 ThrowHelper.ThrowNoElementsException();
6049 }
6050 float num = selector(enumerator.Current);
6051 while (float.IsNaN(num))
6052 {
6053 if (!enumerator.MoveNext())
6054 {
6055 return num;
6056 }
6057 num = selector(enumerator.Current);
6058 }
6059 while (enumerator.MoveNext())
6060 {
6061 float num2 = selector(enumerator.Current);
6062 if (num2 > num)
6063 {
6064 num = num2;
6065 }
6066 }
6067 return num;
6068 }

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