PickHistory

PickHistory stores the recent picks made by a ProbabilityList<T>. It is the small helper type behind convenience properties such as LastPickedIndex, LastPickedValues, and other history-related APIs on the list itself.

Each history entry records:

  • the picked item index
  • the time of the pick

Core members

History access

PROPERTYHistory
List<HistoryEntry>

The underlying list of history entries.

PROPERTYCapacity
int

Maximum number of entries to retain. Minimum value is 1.

PROPERTYLatestIndex
int

Index of the most recent pick, or -1 if history is empty.

PROPERTYLatestEntry
HistoryEntry

The most recent history entry, or null when history is empty.


Retrieval helpers

Retrieval methods

METHODGetLatestEntries
List<HistoryEntry> GetLatestEntries(int count)

Returns a shared list containing the newest history entries.

METHODGetLatestEntries
void GetLatestEntries(List<HistoryEntry> list, int count)

Fills your own list with the newest entries.

METHODGetLatestPicks
List<int> GetLatestPicks(int count)

Returns a shared list of the latest picked item indices.

METHODGetLatestPicks
void GetLatestPicks(List<int> list, int count)

Fills your own list with the latest picked indices.


Mutation helpers

Mutation methods

METHODClearHistory
void ClearHistory()

Removes all history entries and returns them to the pool.

METHODAddEntry
void AddEntry(int index)

Adds one picked index to history.

METHODAddEntries
void AddEntries(NativeList<int> picks)

Adds multiple picks to history in one operation.