Show / Hide Table of Contents

Class IListExtensions

Extension methods for IListExtensions.

Inheritance
object
IListExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Samples.dll
Syntax
public static class IListExtensions

Methods

View Source

RandomChoice<T>(IList<T>, Random?)

Gets a random item from the list.

Declaration
public static T RandomChoice<T>(this IList<T> list, Random? random = null)
Parameters
Type Name Description
IList<T> list

The list.

Random random

An optional instance of Random to use.

Returns
Type Description
T

A random item.

Type Parameters
Name Description
T

The item type.

  • View Source
In this article
Back to top Generated by DocFX