Class WeightedRandom
Inheritance
System.Object
WeightedRandom
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class WeightedRandom
Methods
GetEntries<T>(List<T>, IntRange, ref Dictionary<T, UInt32>, Boolean)
Gets random entries by weight.
Declaration
public static void GetEntries<T>(List<T> source, IntRange countRange, ref Dictionary<T, uint> results, bool allowRepeatingDrops = false)
where T : IWeighted
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | source | Entries to pull from. |
IntRange | countRange | Number of entries to get. |
System.Collections.Generic.Dictionary<T, System.UInt32> | results | Results of entries. Key is the entry, Value is the number of drops. |
System.Boolean | allowRepeatingDrops | True to allow the same entry to be included within results more than once. |
Type Parameters
Name | Description |
---|---|
T |