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

◆ Average() [8/10]

static ? double System.Linq.Enumerable.Average ( this IEnumerable< int?> source)
inlinestatic

Definition at line 3729 of file Enumerable.cs.

3730 {
3731 if (source == null)
3732 {
3733 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
3734 }
3735 checked
3736 {
3738 {
3739 while (enumerator.MoveNext())
3740 {
3741 int? current = enumerator.Current;
3742 if (!current.HasValue)
3743 {
3744 continue;
3745 }
3746 long num = current.GetValueOrDefault();
3747 long num2 = 1L;
3748 while (enumerator.MoveNext())
3749 {
3750 current = enumerator.Current;
3751 if (current.HasValue)
3752 {
3753 num += current.GetValueOrDefault();
3754 num2++;
3755 }
3756 }
3757 return (double)num / (double)num2;
3758 }
3759 }
3760 return null;
3761 }
3762 }

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