Wiki

Clone wiki

RogueSharp / RogueSharp.Random / IRandom / Restore

IRandomRestore Method

Restores the state of the pseudo-random number generator based on the specified state parameter

Namespace: RogueSharp.Random
Assembly:

Syntax

void Restore(
    RandomState state
)

Parameters

state

Type: RogueSharp.RandomRandomState
The state to restore to, usually obtained from calling the Save method

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