Make RandomE support IReadOnlyList<T>#69
Conversation
|
Hello! Thanks for the contribution, good idea. A few years back I didn't want to reference LINQ library, to minimize dependencies and memory footprint. I think I might have used it in one of the examples anyway, I will need to investigate it a bit. The situation with Unity is completely different now, maybe I will just go with it. I will try to take a look at it this weekend, but might have to postpone it to after new year celebrations. |
|
Hey @bluexo! Finally was able to take a look at this idea. |
|
Hey @BasmanovDaniil! Thanks for your reply, I often use the List like this: public SomeClass : MonoBehaviour
{
public IReadonlyList<int> ListProperty => listField;
[SerializeField]
private List<int> listField;
}So , I don't want someone modify the private field. |
This PR make RandomE support IReadOnlyList
GetReadOnlyRandom(this IReadOnlyList list);
GetReadOnlyRandom(this IReadOnlyList list, IReadOnlyList weights);