Skip to content

Conversation

@Diamond-Wolf
Copy link

Added a new variant of Choose() which allows an arbitrary number of arguments.

Added a new variant of Choose() which allows an arbitrary number of arguments.
Remove Nez.Random specification of NextInt() call, since it's being called from within Nez.Random
@prime31
Copy link
Owner

prime31 commented Aug 10, 2021

So, the problem with a method like this is that you pay the price of an array allocation for the params every time you call it. I'm not sure how good of an idea it is to sneak that into the API. If you have more than 4 options it is probably better to have them in an array/List/FastList and just use a random to get the index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants