Wiki

Clone wiki

RogueSharp / RogueSharp.Random / IRandom / Save

IRandomSave Method

Saves the current state of the pseudo-random number generator

Namespace: RogueSharp.Random
Assembly:

Syntax

RandomState Save()

Return Value

Type: RandomState
A RandomState class representing the current state of this pseudo-random number generator

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

IRandom Interface
RogueSharp.Random Namespace

[4]: 2014-2016 Faron Bracy

Updated