Skip to content

Commit e9e16a7

Browse files
committed
Add generic types on Geom
1 parent ae0b3b8 commit e9e16a7

85 files changed

Lines changed: 245 additions & 41 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/geom/circle/Circle.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ var Circle = new Class({
102102
* @method Phaser.Geom.Circle#getPoint
103103
* @since 3.0.0
104104
*
105+
* @generic {Phaser.Geom.Point} O - [out,$return]
106+
*
105107
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
106108
* @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.
107109
*
@@ -119,11 +121,13 @@ var Circle = new Class({
119121
* @method Phaser.Geom.Circle#getPoints
120122
* @since 3.0.0
121123
*
124+
* @generic {Phaser.Geom.Point[]} O - [output,$return]
125+
*
122126
* @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.
123127
* @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate.
124-
* @param {array} [output] - An array to insert the points in to. If not provided a new array will be created.
128+
* @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created.
125129
*
126-
* @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the circumference of the circle.
130+
* @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the circle.
127131
*/
128132
getPoints: function (quantity, stepRate, output)
129133
{
@@ -136,6 +140,8 @@ var Circle = new Class({
136140
* @method Phaser.Geom.Circle#getRandomPoint
137141
* @since 3.0.0
138142
*
143+
* @generic {Phaser.Geom.Point} O - [point,$return]
144+
*
139145
* @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.
140146
*
141147
* @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.

src/geom/circle/CircumferencePoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var Point = require('../point/Point');
1212
* @function Phaser.Geom.Circle.CircumferencePoint
1313
* @since 3.0.0
1414
*
15+
* @generic {Phaser.Geom.Point} O - [out,$return]
16+
*
1517
* @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on.
1618
* @param {number} angle - The angle from the center of the Circle to the circumference to return the point from. Given in radians.
1719
* @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.

src/geom/circle/CopyFrom.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* @function Phaser.Geom.Circle.CopyFrom
1212
* @since 3.0.0
1313
*
14+
* @generic {Phaser.Geom.Circle} O - [dest,$return]
15+
*
1416
* @param {Phaser.Geom.Circle} source - The source Circle to copy the values from.
1517
* @param {Phaser.Geom.Circle} dest - The destination Circle to copy the values to.
1618
*

src/geom/circle/GetBounds.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var Rectangle = require('../rectangle/Rectangle');
1212
* @function Phaser.Geom.Circle.GetBounds
1313
* @since 3.0.0
1414
*
15+
* @generic {Phaser.Geom.Rectangle} O - [out,$return]
16+
*
1517
* @param {Phaser.Geom.Circle} circle - The Circle to get the bounds from.
1618
* @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created.
1719
*

src/geom/circle/GetPoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var Point = require('../point/Point');
1717
* @function Phaser.Geom.Circle.GetPoint
1818
* @since 3.0.0
1919
*
20+
* @generic {Phaser.Geom.Point} O - [out,$return]
21+
*
2022
* @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on.
2123
* @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
2224
* @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.

src/geom/circle/Offset.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* @function Phaser.Geom.Circle.Offset
1111
* @since 3.0.0
1212
*
13+
* @generic {Phaser.Geom.Circle} O - [circle,$return]
14+
*
1315
* @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.)
1416
* @param {number} x - The amount to horizontally offset the Circle by.
1517
* @param {number} y - The amount to vertically offset the Circle by.

src/geom/circle/OffsetPoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* @function Phaser.Geom.Circle.OffsetPoint
1111
* @since 3.0.0
1212
*
13+
* @generic {Phaser.Geom.Circle} O - [circle,$return]
14+
*
1315
* @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.)
1416
* @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Circle by.
1517
*

src/geom/circle/Random.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ var Point = require('../point/Point');
1212
* @function Phaser.Geom.Circle.Random
1313
* @since 3.0.0
1414
*
15+
* @generic {Phaser.Geom.Point} O - [out,$return]
16+
*
1517
* @param {Phaser.Geom.Circle} circle - The Circle to get a random point from.
16-
* @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.
18+
* @param {(Phaser.Geom.Point|object)} [out] - A Point or point-like object to set the random `x` and `y` values in.
1719
*
1820
* @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.
1921
*/

src/geom/ellipse/CircumferencePoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var Point = require('../point/Point');
1212
* @function Phaser.Geom.Ellipse.CircumferencePoint
1313
* @since 3.0.0
1414
*
15+
* @generic {Phaser.Geom.Point} O - [out,$return]
16+
*
1517
* @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on.
1618
* @param {number} angle - The angle from the center of the Ellipse to the circumference to return the point from. Given in radians.
1719
* @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.

src/geom/ellipse/CopyFrom.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* @function Phaser.Geom.Ellipse.CopyFrom
1212
* @since 3.0.0
1313
*
14+
* @generic {Phaser.Geom.Ellipse} O - [dest,$return]
15+
*
1416
* @param {Phaser.Geom.Ellipse} source - The source Ellipse to copy the values from.
1517
* @param {Phaser.Geom.Ellipse} dest - The destination Ellipse to copy the values to.
1618
*

0 commit comments

Comments
 (0)