CompiledWeightedTable<T> class

Pre-validates a weighted loot table ONCE at construction — compiling it into cumulative weights so repeated pick calls (e.g. every enemy spawn, every loot roll) don't re-validate and re-sum the whole table every time the way a bare weightedRandomPick call does.

Constructors

CompiledWeightedTable(List<T> items, List<double> weights)
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pick(Random random) → T
Picks 1 item, probability proportional to its compiled weight. No re-validation — that already happened once, at construction.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited