Skip to content

Commit 08b4597

Browse files
committed
Improved JSDocs
1 parent 99c1254 commit 08b4597

9 files changed

Lines changed: 125 additions & 12 deletions

File tree

src/utils/array/matrix/CheckMatrix.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@
77
/**
88
* Checks if an array can be used as a matrix.
99
*
10-
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows:
10+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
11+
* have the same length. There must be at least two rows. This is an example matrix:
1112
*
1213
* ```
13-
* [
14-
* [ 1, 1, 1, 1, 1, 1 ],
15-
* [ 2, 0, 0, 0, 0, 4 ],
16-
* [ 2, 0, 1, 2, 0, 4 ],
17-
* [ 2, 0, 3, 4, 0, 4 ],
18-
* [ 2, 0, 0, 0, 0, 4 ],
19-
* [ 3, 3, 3, 3, 3, 3 ]
20-
* ]
14+
* [
15+
* [ 1, 1, 1, 1, 1, 1 ],
16+
* [ 2, 0, 0, 0, 0, 4 ],
17+
* [ 2, 0, 1, 2, 0, 4 ],
18+
* [ 2, 0, 3, 4, 0, 4 ],
19+
* [ 2, 0, 0, 0, 0, 4 ],
20+
* [ 3, 3, 3, 3, 3, 3 ]
21+
* ]
2122
* ```
2223
*
2324
* @function Phaser.Utils.Array.Matrix.CheckMatrix
2425
* @since 3.0.0
25-
*
26+
*
2627
* @generic T
2728
* @genericUse {T[][]} - [matrix]
2829
*

src/utils/array/matrix/MatrixToString.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ var CheckMatrix = require('./CheckMatrix');
1010
/**
1111
* Generates a string (which you can pass to console.log) from the given Array Matrix.
1212
*
13+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
14+
* have the same length. There must be at least two rows. This is an example matrix:
15+
*
16+
* ```
17+
* [
18+
* [ 1, 1, 1, 1, 1, 1 ],
19+
* [ 2, 0, 0, 0, 0, 4 ],
20+
* [ 2, 0, 1, 2, 0, 4 ],
21+
* [ 2, 0, 3, 4, 0, 4 ],
22+
* [ 2, 0, 0, 0, 0, 4 ],
23+
* [ 3, 3, 3, 3, 3, 3 ]
24+
* ]
25+
* ```
26+
*
1327
* @function Phaser.Utils.Array.Matrix.MatrixToString
1428
* @since 3.0.0
1529
*

src/utils/array/matrix/ReverseColumns.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
/**
88
* Reverses the columns in the given Array Matrix.
99
*
10+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
11+
* have the same length. There must be at least two rows. This is an example matrix:
12+
*
13+
* ```
14+
* [
15+
* [ 1, 1, 1, 1, 1, 1 ],
16+
* [ 2, 0, 0, 0, 0, 4 ],
17+
* [ 2, 0, 1, 2, 0, 4 ],
18+
* [ 2, 0, 3, 4, 0, 4 ],
19+
* [ 2, 0, 0, 0, 0, 4 ],
20+
* [ 3, 3, 3, 3, 3, 3 ]
21+
* ]
22+
* ```
23+
*
1024
* @function Phaser.Utils.Array.Matrix.ReverseColumns
1125
* @since 3.0.0
1226
*

src/utils/array/matrix/ReverseRows.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
/**
88
* Reverses the rows in the given Array Matrix.
99
*
10+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
11+
* have the same length. There must be at least two rows. This is an example matrix:
12+
*
13+
* ```
14+
* [
15+
* [ 1, 1, 1, 1, 1, 1 ],
16+
* [ 2, 0, 0, 0, 0, 4 ],
17+
* [ 2, 0, 1, 2, 0, 4 ],
18+
* [ 2, 0, 3, 4, 0, 4 ],
19+
* [ 2, 0, 0, 0, 0, 4 ],
20+
* [ 3, 3, 3, 3, 3, 3 ]
21+
* ]
22+
* ```
23+
*
1024
* @function Phaser.Utils.Array.Matrix.ReverseRows
1125
* @since 3.0.0
1226
*

src/utils/array/matrix/Rotate180.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ var RotateMatrix = require('./RotateMatrix');
99
/**
1010
* Rotates the array matrix 180 degrees.
1111
*
12+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
13+
* have the same length. There must be at least two rows. This is an example matrix:
14+
*
15+
* ```
16+
* [
17+
* [ 1, 1, 1, 1, 1, 1 ],
18+
* [ 2, 0, 0, 0, 0, 4 ],
19+
* [ 2, 0, 1, 2, 0, 4 ],
20+
* [ 2, 0, 3, 4, 0, 4 ],
21+
* [ 2, 0, 0, 0, 0, 4 ],
22+
* [ 3, 3, 3, 3, 3, 3 ]
23+
* ]
24+
* ```
25+
*
1226
* @function Phaser.Utils.Array.Matrix.Rotate180
1327
* @since 3.0.0
1428
*

src/utils/array/matrix/RotateLeft.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ var RotateMatrix = require('./RotateMatrix');
99
/**
1010
* Rotates the array matrix to the left (or 90 degrees)
1111
*
12+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
13+
* have the same length. There must be at least two rows. This is an example matrix:
14+
*
15+
* ```
16+
* [
17+
* [ 1, 1, 1, 1, 1, 1 ],
18+
* [ 2, 0, 0, 0, 0, 4 ],
19+
* [ 2, 0, 1, 2, 0, 4 ],
20+
* [ 2, 0, 3, 4, 0, 4 ],
21+
* [ 2, 0, 0, 0, 0, 4 ],
22+
* [ 3, 3, 3, 3, 3, 3 ]
23+
* ]
24+
* ```
25+
*
1226
* @function Phaser.Utils.Array.Matrix.RotateLeft
1327
* @since 3.0.0
1428
*

src/utils/array/matrix/RotateMatrix.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ var TransposeMatrix = require('./TransposeMatrix');
1515
*
1616
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
1717
*
18+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
19+
* have the same length. There must be at least two rows. This is an example matrix:
20+
*
21+
* ```
22+
* [
23+
* [ 1, 1, 1, 1, 1, 1 ],
24+
* [ 2, 0, 0, 0, 0, 4 ],
25+
* [ 2, 0, 1, 2, 0, 4 ],
26+
* [ 2, 0, 3, 4, 0, 4 ],
27+
* [ 2, 0, 0, 0, 0, 4 ],
28+
* [ 3, 3, 3, 3, 3, 3 ]
29+
* ]
30+
* ```
31+
*
1832
* @function Phaser.Utils.Array.Matrix.RotateMatrix
1933
* @since 3.0.0
2034
*

src/utils/array/matrix/RotateRight.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ var RotateMatrix = require('./RotateMatrix');
99
/**
1010
* Rotates the array matrix to the left (or -90 degrees)
1111
*
12+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
13+
* have the same length. There must be at least two rows. This is an example matrix:
14+
*
15+
* ```
16+
* [
17+
* [ 1, 1, 1, 1, 1, 1 ],
18+
* [ 2, 0, 0, 0, 0, 4 ],
19+
* [ 2, 0, 1, 2, 0, 4 ],
20+
* [ 2, 0, 3, 4, 0, 4 ],
21+
* [ 2, 0, 0, 0, 0, 4 ],
22+
* [ 3, 3, 3, 3, 3, 3 ]
23+
* ]
24+
* ```
25+
*
1226
* @function Phaser.Utils.Array.Matrix.RotateRight
1327
* @since 3.0.0
1428
*

src/utils/array/matrix/TransposeMatrix.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,26 @@
99
*
1010
* The transpose of a matrix is a new matrix whose rows are the columns of the original.
1111
*
12+
* A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)
13+
* have the same length. There must be at least two rows. This is an example matrix:
14+
*
15+
* ```
16+
* [
17+
* [ 1, 1, 1, 1, 1, 1 ],
18+
* [ 2, 0, 0, 0, 0, 4 ],
19+
* [ 2, 0, 1, 2, 0, 4 ],
20+
* [ 2, 0, 3, 4, 0, 4 ],
21+
* [ 2, 0, 0, 0, 0, 4 ],
22+
* [ 3, 3, 3, 3, 3, 3 ]
23+
* ]
24+
* ```
25+
*
1226
* @function Phaser.Utils.Array.Matrix.TransposeMatrix
1327
* @since 3.0.0
14-
*
28+
*
1529
* @generic T
1630
* @genericUse {T[][]} - [array,$return]
17-
*
31+
*
1832
* @param {T[][]} [array] - The array matrix to transpose.
1933
*
2034
* @return {T[][]} A new array matrix which is a transposed version of the given array.

0 commit comments

Comments
 (0)