Skip to content

Commit 4a0aaa8

Browse files
committed
added RandomDataGenerator.state() typescript definitions
1 parent 5703178 commit 4a0aaa8

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

typescript/phaser.comments.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20512,6 +20512,24 @@ declare module Phaser {
2051220512
*/
2051320513
sow(seeds: number[]): void;
2051420514

20515+
/**
20516+
* Gets or Sets the state of the generator. This allows you to retain the values
20517+
* that the generator is using between games, i.e. in a game save file.
20518+
*
20519+
* To seed this generator with a previously saved state you can pass it as the
20520+
* `seed` value in your game config, or call this method directly after Phaser has booted.
20521+
*
20522+
* Call this method with no parameters to return the current state.
20523+
*
20524+
* If providing a state it should match the same format that this method
20525+
* returns, which is a string with a header `!rnd` followed by the `c`,
20526+
* `s0`, `s1` and `s2` values respectively, each comma-delimited.
20527+
*
20528+
* @param state Generator state to be set.
20529+
* @return The current state of the generator.
20530+
*/
20531+
state(state: string): string;
20532+
2051520533
/**
2051620534
* Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified.
2051720535
*

typescript/phaser.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,6 +3803,7 @@ declare module Phaser {
38033803
real(): number;
38043804
realInRange(min: number, max: number): number;
38053805
sow(seeds: number[]): void;
3806+
state(state: string): string;
38063807
timestamp(min: number, max: number): number;
38073808
uuid(): number;
38083809
weightedPick<T>(ary: T[]): T;

0 commit comments

Comments
 (0)