Method ChooseUniformRandom
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
ChooseUniformRandom<TSource>(IList<TSource>)
Make a generator that randomly generates elements from a list.
public static IGenerator<TSource> ChooseUniformRandom<TSource>(IList<TSource> list)Parameters
- listIList<TSource>
- The source list. 
Returns
- IGenerator<TSource>
- A new generator. 
Type Parameters
- TSource
- The type of elements to generate. 
Exceptions
- ArgumentNullException
- listis null
- ArgumentException
- listis empty.
ChooseUniformRandom<TSource>(IList<TSource>, int)
Make a generator that randomly generates elements from a list. Can be seeded.
public static IGenerator<TSource> ChooseUniformRandom<TSource>(IList<TSource> list, int seed)Parameters
Returns
- IGenerator<TSource>
- A new generator. 
Type Parameters
- TSource
- The type of elements to generate. 
Exceptions
- ArgumentNullException
- listis null
- ArgumentException
- listis empty.
ChooseUniformRandom<TSource>(IList<IGenerator<TSource>>)
Makes a generator that selects a random generator from a given element to generate an element from.
public static IGenerator<TSource> ChooseUniformRandom<TSource>(IList<IGenerator<TSource>> list)Parameters
- listIList<IGenerator<TSource>>
- The list of generators to choose from. 
Returns
- IGenerator<TSource>
- A new generator. 
Type Parameters
- TSource
- The type of elements to generate. 
Exceptions
- ArgumentNullException
- listis $(null).
- ArgumentException
- listis empty or has null elements.
ChooseUniformRandom<TSource>(params IGenerator<TSource>[])
Chooses the from the given generators selected uniform randomly.
[Obsolete("Use an appropriate overload instead.")]
public static IGenerator<TSource> ChooseUniformRandom<TSource>(params IGenerator<TSource>[] list)Parameters
- listIGenerator<TSource>[]
Returns
- IGenerator<TSource>
- IGenerator<TSource>. 
Type Parameters
- TSource
ChooseUniformRandom<TSource>(IList<IGenerator<TSource>>, int)
Chooses the random.
public static IGenerator<TSource> ChooseUniformRandom<TSource>(IList<IGenerator<TSource>> list, int seed)Parameters
- listIList<IGenerator<TSource>>
- The list. 
- seedint
- The seed. 
Returns
- IGenerator<TSource>
- IGenerator<TSource>. 
Type Parameters
- TSource
- The type of the t source. 
Exceptions
- ArgumentNullException
- listis $(null).
- ArgumentException
- listis empty or has null elements.