IListExtensionsGetRandomElementT Method

Chooses a random element from the given list.

Definition

Namespace: SimpleAIPlayer
Assembly: SimpleAIPlayer (in SimpleAIPlayer.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
C#
public static T GetRandomElement<T>(
	this IList<T> list
)

Parameters

list  IListT
The list to choose from.

Type Parameters

T

Return Value

T
A random element from list.

Usage Note

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).

See Also