core/utils/weighted_random_pick library
Functions
-
weightedRandomPick<
T> (List< T> items, List<double> weights, {Random? random}) → T -
Picks 1 item from
itemswith probability proportional to the matching entry inweights— the shared loot-table/gacha-reward primitive so each new reward system (achievements, offline earnings, …) doesn't reimplement this. Pass a seededrandomin tests for determinism.