Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add params variant of Choose() #688

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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