RobustToolbox
RobustToolbox copied to clipboard
Feature/refine robust random and cleanup
Refined xml-doc for IRobustRandom
Changed RobustRandom namespace to be file-scoped
Added new methods to RandomExtensions for getting list of random items from collections:
IReadOnlyCollection<T> GetItems<T>(this IRobustRandom random, IList<T> collection, int count, bool allowDuplicates = true);
ValueList<T> GetItems<T>(this IRobustRandom random, ValueList<T> collection, int count, bool allowDuplicates = true);
Span<T> GetItems<T>(this IRobustRandom random, Span<T> collection, int count, bool allowDuplicates = true);
Main scenarios for new methods:
- Need to pick item random from list of items
- Need to pick several random items from list, only unique
- Need to pick items from list several times, duplicates allowed.
Separated refactoring and adding code into separate commits for comfortable code-review.
@ElectroJr can u pls close comments if they are fixed correctly?
Just bulldoze https://github.com/space-wizards/RobustToolbox/pull/4980
I woulda merged yours first but wasn't sure on some changes.
Needs release notes.
Done (question mark)
Just bulldoze #4980
I woulda merged yours first but wasn't sure on some changes.
merged as well as i could