Open
Conversation
2 tasks
…dom. Improved docs for IRobustRandom.
Tayrtahn
reviewed
Mar 15, 2026
Member
slarticodefast
left a comment
There was a problem hiding this comment.
Resolves #5995 since the System.Random implementation of NextFloat does not have that problem. We just have to make sure not to reintroduce it if we want to replace System.Random.
Tayrtahn
reviewed
Mar 16, 2026
Tayrtahn
reviewed
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates a bunch of implicitly defined functions on IRobustRandom to be extension methods instead, adds some new static constructors for ease of use, deprecates SetSeed, adds a new marker interface for "this mustn't be the global randomizer", all while keeping content compatibility*
Technical reasoning
Extension methods
Methods defined on interfaces cannot be called on concrete types. While this isn't a problem yet, it will be when I introduce a concretely typed, serializable randomizer.
Interface-level static constructors
This is to allow us to change implementations down the line, RobustRandom's internals rely on System.Random, which has a bunch of flaws for our usecase (including poor rng properties when seeded)
*if the content PR is merged.