Dice.Roll<T>

Static Method in Dice

Declaration

public static T Roll<T>(T[] dice)

Description

Rolls a custom dice.

Type Parameters

TThe type of values of the dice.

Parameters

diceThe values of the dice.

Returns

TA random value on the dice.

Overload

Declaration

public static T Roll<T>(T[] dice, int[] weights)

Description

Rolls a custom dice with weighted probabilities.

Type Parameters

TThe type of values of the dice.

Parameters

diceThe values of the dice.
weightsThe probabilities of each value.

Returns

TA random value on the dice.