added RandomDataGenerator.state() typescript definitions

This commit is contained in:
Stafford Williams 2016-02-02 13:21:45 +11:00
parent 5703178ee4
commit 4a0aaa8914
2 changed files with 19 additions and 0 deletions

View file

@ -20512,6 +20512,24 @@ declare module Phaser {
*/
sow(seeds: number[]): void;
/**
* Gets or Sets the state of the generator. This allows you to retain the values
* that the generator is using between games, i.e. in a game save file.
*
* To seed this generator with a previously saved state you can pass it as the
* `seed` value in your game config, or call this method directly after Phaser has booted.
*
* Call this method with no parameters to return the current state.
*
* If providing a state it should match the same format that this method
* returns, which is a string with a header `!rnd` followed by the `c`,
* `s0`, `s1` and `s2` values respectively, each comma-delimited.
*
* @param state Generator state to be set.
* @return The current state of the generator.
*/
state(state: string): string;
/**
* 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.
*

View file

@ -3803,6 +3803,7 @@ declare module Phaser {
real(): number;
realInRange(min: number, max: number): number;
sow(seeds: number[]): void;
state(state: string): string;
timestamp(min: number, max: number): number;
uuid(): number;
weightedPick<T>(ary: T[]): T;