mirror of
https://github.com/photonstorm/phaser
synced 2024-11-13 08:27:25 +00:00
Merge pull request #4892 from BeLi4L/master
TypeScript: Improve `Phaser.Math.RND` types
This commit is contained in:
commit
55212dc2fb
2 changed files with 22 additions and 8 deletions
|
@ -347,10 +347,14 @@ var RandomDataGenerator = new Class({
|
||||||
*
|
*
|
||||||
* @method Phaser.Math.RandomDataGenerator#pick
|
* @method Phaser.Math.RandomDataGenerator#pick
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
|
*
|
||||||
|
* @generic T
|
||||||
|
* @genericUse {T[]} - [array]
|
||||||
|
* @genericUse {T} - [$return]
|
||||||
*
|
*
|
||||||
* @param {array} array - The array to pick a random element from.
|
* @param {T[]} array - The array to pick a random element from.
|
||||||
*
|
*
|
||||||
* @return {*} A random member of the array.
|
* @return {T} A random member of the array.
|
||||||
*/
|
*/
|
||||||
pick: function (array)
|
pick: function (array)
|
||||||
{
|
{
|
||||||
|
@ -376,9 +380,13 @@ var RandomDataGenerator = new Class({
|
||||||
* @method Phaser.Math.RandomDataGenerator#weightedPick
|
* @method Phaser.Math.RandomDataGenerator#weightedPick
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {array} array - The array to pick a random element from.
|
* @generic T
|
||||||
|
* @genericUse {T[]} - [array]
|
||||||
|
* @genericUse {T} - [$return]
|
||||||
*
|
*
|
||||||
* @return {*} A random member of the array.
|
* @param {T[]} array - The array to pick a random element from.
|
||||||
|
*
|
||||||
|
* @return {T} A random member of the array.
|
||||||
*/
|
*/
|
||||||
weightedPick: function (array)
|
weightedPick: function (array)
|
||||||
{
|
{
|
||||||
|
@ -468,9 +476,12 @@ var RandomDataGenerator = new Class({
|
||||||
* @method Phaser.Math.RandomDataGenerator#shuffle
|
* @method Phaser.Math.RandomDataGenerator#shuffle
|
||||||
* @since 3.7.0
|
* @since 3.7.0
|
||||||
*
|
*
|
||||||
* @param {array} [array] - The array to be shuffled.
|
* @generic T
|
||||||
|
* @genericUse {T[]} - [array,$return]
|
||||||
*
|
*
|
||||||
* @return {array} The shuffled array.
|
* @param {T[]} [array] - The array to be shuffled.
|
||||||
|
*
|
||||||
|
* @return {T[]} The shuffled array.
|
||||||
*/
|
*/
|
||||||
shuffle: function (array)
|
shuffle: function (array)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,9 +12,12 @@
|
||||||
* @function Phaser.Utils.Array.Shuffle
|
* @function Phaser.Utils.Array.Shuffle
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param {array} array - The array to shuffle. This array is modified in place.
|
* @generic T
|
||||||
|
* @genericUse {T[]} - [array,$return]
|
||||||
*
|
*
|
||||||
* @return {array} The shuffled array.
|
* @param {T[]} array - The array to shuffle. This array is modified in place.
|
||||||
|
*
|
||||||
|
* @return {T[]} The shuffled array.
|
||||||
*/
|
*/
|
||||||
var Shuffle = function (array)
|
var Shuffle = function (array)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue