GodotWeightedPoolExtensions
Namespace: Shadop.Archmage.Sdk
Provides parameterless Sample and SampleIndex extension methods that draw an
item from a WeightedPoolGD.Seed affects.
public static class GodotWeightedPoolExtensionsInheritance Object → GodotWeightedPoolExtensions
Methods
Section titled “Methods”Sample(WeightedPool)
Section titled “Sample(WeightedPool)”Returns a randomly selected item, weighted by the pool’s weights. Throws if the pool is empty or the total weight is zero.
public static T Sample<T>(WeightedPool<T> wp)Parameters
Section titled “Parameters”wp WeightedPool
Returns
Section titled “Returns”T
SampleIndex(WeightedPool)
Section titled “SampleIndex(WeightedPool)”Returns the index of a randomly selected item, weighted by the pool’s weights. Throws if the pool is empty or the total weight is zero.
public static int SampleIndex<T>(WeightedPool<T> wp)Parameters
Section titled “Parameters”wp WeightedPool