JUtils
A unity utilities library
JUtils.WeightedExtensions Class Reference

Contains helper functions for working with Weighted Randomness More...

Static Public Member Functions

static T WeightedRandom< T > (this IList< Weighted< T >> weightedArray)
 Get a random weighted value using UnityEngine.Random More...
 
static T WeightedRandom< T > (this IList< Weighted< T >> weightedArray, Random random)
 Get a random weighted value using System.Random More...
 
static T WeightedRandom< T > (this IList< T > weightedArray)
 Get a random weighted value using UnityEngine.Random More...
 
static T WeightedRandom< T > (this IList< T > weightedArray, Random random)
 Get a random weighted value using System.Random More...
 
static T GetWeightedValue< T > (this IList< T > weightedArray, float weightedIndex)
 Get a weighted value at a certain index More...
 
static float WeightedSum< T > (this IList< T > weightedArray)
 Get the sum of a weighted array More...
 

Detailed Description

Contains helper functions for working with Weighted Randomness

Member Function Documentation

◆ GetWeightedValue< T >()

static T JUtils.WeightedExtensions.GetWeightedValue< T > ( this IList< T >  weightedArray,
float  weightedIndex 
)
inlinestatic

Get a weighted value at a certain index

Type Constraints
T :IWeighted 

References JUtils.IWeighted.weight.

◆ WeightedRandom< T >() [1/4]

static T JUtils.WeightedExtensions.WeightedRandom< T > ( this IList< T >  weightedArray)
inlinestatic

Get a random weighted value using UnityEngine.Random

Type Constraints
T :IWeighted 

◆ WeightedRandom< T >() [2/4]

static T JUtils.WeightedExtensions.WeightedRandom< T > ( this IList< T >  weightedArray,
Random  random 
)
inlinestatic

Get a random weighted value using System.Random

Type Constraints
T :IWeighted 

◆ WeightedRandom< T >() [3/4]

static T JUtils.WeightedExtensions.WeightedRandom< T > ( this IList< Weighted< T >>  weightedArray)
inlinestatic

Get a random weighted value using UnityEngine.Random

◆ WeightedRandom< T >() [4/4]

static T JUtils.WeightedExtensions.WeightedRandom< T > ( this IList< Weighted< T >>  weightedArray,
Random  random 
)
inlinestatic

Get a random weighted value using System.Random

◆ WeightedSum< T >()

static float JUtils.WeightedExtensions.WeightedSum< T > ( this IList< T >  weightedArray)
inlinestatic

Get the sum of a weighted array

Type Constraints
T :IWeighted 

References JUtils.IWeighted.weight.


The documentation for this class was generated from the following file: