ListExtensions
FivePD.API.Utils
#
Namespace: Source/Utils/ListExtensions.cs
#
File: #
List extensions#
SelectRandom<T>public static T SelectRandom<T>(this IEnumerable<T> enumerable);
Selects a random element from the given list.
Params:
- enumerable
- Type: IEnumerable<T>
- Collection - random result will be selected from this list
public static T SelectRandom<T>(this IEnumerable<T> enumerable, IEnumerable<T> exclusions);
Excludes the given elements (won't be selected).
Params:
- enumerable
- Type: IEnumerable<T>
- Collection - random result will be selected from this list
- exclusions
- Type: IEnumerable<T>
- Collection - the random result can't be any of these