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

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

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

Definition at line 6201 of file Enumerable.cs.

6202 {
6203 if (source == null)
6204 {
6205 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6206 }
6207 if (selector == null)
6208 {
6209 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
6210 }
6211 using IEnumerator<TSource> enumerator = source.GetEnumerator();
6212 if (!enumerator.MoveNext())
6213 {
6214 ThrowHelper.ThrowNoElementsException();
6215 }
6216 decimal num = selector(enumerator.Current);
6217 while (enumerator.MoveNext())
6218 {
6219 decimal num2 = selector(enumerator.Current);
6220 if (num2 > num)
6221 {
6222 num = num2;
6223 }
6224 }
6225 return num;
6226 }

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