IListExtensionsGetRandomElementT Method
Chooses a random element from the given list.
Namespace: SimpleAIPlayerAssembly: SimpleAIPlayer (in SimpleAIPlayer.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
public static T GetRandomElement<T>(
this IList<T> list
)
- list IListT
- The list to choose from.
- T
TA random element from
list.In Visual Basic and C#, you can call this method as an instance method on any object of type
IListT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).