Wiki
Clone wikiRogueSharp / RogueSharp.Random / DotNetRandom / Restore
DotNetRandomRestore Method
Restores the state of the pseudo-random number generator based on the specified state parameter
Namespace: RogueSharp.Random
Assembly:
Syntax
public void Restore( RandomState state )
Parameters
state
Type: RogueSharp.RandomRandomState
The state to restore to, usually obtained from calling the Save method
Implements
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | RandomState cannot be null |
Examples
If you generated three random numbers and then called Save to store the state and followed that up by generating 10 more numbers before calling Restore with the previously saved RandomState the Restore method should return the generator back to the state when Save was first called. This means that if you went on to generate 10 more numbers they would be the same 10 numbers that were generated the first time after Save was called.
See Also
Reference
DotNetRandom Class
RogueSharp.Random Namespace
[5]: 2014-2016 Faron Bracy
Updated