M&B: Bannerlord 1.0.0
The horns sound, the ravens gather.
|
Selects distinct entries from a list in random. Does not modify the original list. But keeps a reference to it More...
Classes | |
struct | IndexEntry |
Public Member Functions | |
MBFastRandomSelector (ushort capacity=MinimumCapacity) | |
MBFastRandomSelector (IReadOnlyList< T > list, ushort capacity=MinimumCapacity) | |
void | Initialize (IReadOnlyList< T > list) |
void | Reset () |
void | Pack () |
Reduces the capacity of the selector to list capacity if a selection list is initialized. Or minimum capacity More... | |
bool | SelectRandom (out T selection, Predicate< T > conditions=null) |
Picks the next random entry in the selection list satisfying conditions More... | |
Static Public Attributes | |
const ushort | MinimumCapacity = 32 |
const ushort | MaximumCapacity = ushort.MaxValue |
Properties | |
ushort | RemainingCount [get] |
REMARK_ATES: Can operate on a list with up to 65,535 elements (max range of 16bit unsigned short) for memory/performance considerations REMARK_ATES: Any changes to the original list will invalidate the random selector.
TaleWorlds.Core.MBFastRandomSelector< T >.MBFastRandomSelector | ( | ushort | capacity = MinimumCapacity | ) |
TaleWorlds.Core.MBFastRandomSelector< T >.MBFastRandomSelector | ( | IReadOnlyList< T > | list, |
ushort | capacity = MinimumCapacity |
||
) |
void TaleWorlds.Core.MBFastRandomSelector< T >.Initialize | ( | IReadOnlyList< T > | list | ) |
void TaleWorlds.Core.MBFastRandomSelector< T >.Reset | ( | ) |
void TaleWorlds.Core.MBFastRandomSelector< T >.Pack | ( | ) |
bool TaleWorlds.Core.MBFastRandomSelector< T >.SelectRandom | ( | out T | selection, |
Predicate< T > | conditions = null |
||
) |
|
static |
|
static |
|
get |