Skip to content

Commit eea1b34

Browse files
committed
Added jsdocs
1 parent ec443cc commit eea1b34

7 files changed

Lines changed: 66 additions & 50 deletions

File tree

src/scene/Scene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var Systems = require('./Systems');
99

1010
/**
1111
* @classdesc
12-
* [description]
12+
* A base Phaser.Scene class which you could extend for your own use.
1313
*
1414
* @class Scene
1515
* @memberof Phaser

src/scene/Settings.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@ var InjectionMap = require('./InjectionMap');
1616
/**
1717
* @typedef {object} Phaser.Scenes.Settings.Config
1818
*
19-
* @property {string} [key] - [description]
20-
* @property {boolean} [active=false] - [description]
21-
* @property {boolean} [visible=true] - [description]
22-
* @property {(false|Phaser.Loader.FileTypes.PackFileConfig)} [pack=false] - [description]
23-
* @property {?(InputJSONCameraObject|InputJSONCameraObject[])} [cameras=null] - [description]
19+
* @property {string} [key] - The unique key of this Scene. Must be unique within the entire Game instance.
20+
* @property {boolean} [active=false] - Does the Scene start as active or not? An active Scene updates each step.
21+
* @property {boolean} [visible=true] - Does the Scene start as visible or not? A visible Scene renders each step.
22+
* @property {(false|Phaser.Loader.FileTypes.PackFileConfig)} [pack=false] - An optional Loader Packfile to be loaded before the Scene begins.
23+
* @property {?(InputJSONCameraObject|InputJSONCameraObject[])} [cameras=null] - An optional Camera configuration object.
2424
* @property {Object.<string, string>} [map] - Overwrites the default injection map for a scene.
2525
* @property {Object.<string, string>} [mapAdd] - Extends the injection map for a scene.
26-
* @property {object} [physics={}] - [description]
27-
* @property {object} [loader={}] - [description]
28-
* @property {(false|*)} [plugins=false] - [description]
26+
* @property {object} [physics={}] - The physics configuration object for the Scene.
27+
* @property {object} [loader={}] - The loader configuration object for the Scene.
28+
* @property {(false|*)} [plugins=false] - The plugin configuration object for the Scene.
2929
*/
3030

3131
/**
3232
* @typedef {object} Phaser.Scenes.Settings.Object
3333
*
34-
* @property {number} status - [description]
35-
* @property {string} key - [description]
36-
* @property {boolean} active - [description]
37-
* @property {boolean} visible - [description]
38-
* @property {boolean} isBooted - [description]
39-
* @property {boolean} isTransition - [description]
40-
* @property {?Phaser.Scene} transitionFrom - [description]
41-
* @property {integer} transitionDuration - [description]
42-
* @property {boolean} transitionAllowInput - [description]
43-
* @property {object} data - [description]
44-
* @property {(false|Phaser.Loader.FileTypes.PackFileConfig)} pack - [description]
45-
* @property {?(InputJSONCameraObject|InputJSONCameraObject[])} cameras - [description]
46-
* @property {Object.<string, string>} map - [description]
47-
* @property {object} physics - [description]
48-
* @property {object} loader - [description]
49-
* @property {(false|*)} plugins - [description]
34+
* @property {number} status - The current status of the Scene. Maps to the Scene constants.
35+
* @property {string} key - The unique key of this Scene. Unique within the entire Game instance.
36+
* @property {boolean} active - The active state of this Scene. An active Scene updates each step.
37+
* @property {boolean} visible - The visible state of this Scene. A visible Scene renders each step.
38+
* @property {boolean} isBooted - Has the Scene finished booting?
39+
* @property {boolean} isTransition - Is the Scene in a state of transition?
40+
* @property {?Phaser.Scene} transitionFrom - The Scene this Scene is transitioning from, if set.
41+
* @property {integer} transitionDuration - The duration of the transition, if set.
42+
* @property {boolean} transitionAllowInput - Is this Scene allowed to receive input during transitions?
43+
* @property {object} data - a data bundle passed to this Scene from the Scene Manager.
44+
* @property {(false|Phaser.Loader.FileTypes.PackFileConfig)} pack - The Loader Packfile to be loaded before the Scene begins.
45+
* @property {?(InputJSONCameraObject|InputJSONCameraObject[])} cameras - The Camera configuration object.
46+
* @property {Object.<string, string>} map - The Scene's Injection Map.
47+
* @property {object} physics - The physics configuration object for the Scene.
48+
* @property {object} loader - The loader configuration object for the Scene.
49+
* @property {(false|*)} plugins - The plugin configuration object for the Scene.
5050
*/
5151

5252
var Settings = {
5353

5454
/**
55-
* Takes a Scene configuration object and returns a fully formed Systems object.
55+
* Takes a Scene configuration object and returns a fully formed System Settings object.
5656
*
5757
* @function Phaser.Scenes.Settings.create
5858
* @since 3.0.0
5959
*
60-
* @param {(string|Phaser.Scenes.Settings.Config)} config - [description]
60+
* @param {(string|Phaser.Scenes.Settings.Config)} config - The Scene configuration object used to create this Scene Settings.
6161
*
62-
* @return {Phaser.Scenes.Settings.Object} [description]
62+
* @return {Phaser.Scenes.Settings.Object} The Scene Settings object created as a result of the config and default settings.
6363
*/
6464
create: function (config)
6565
{

src/structs/List.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ var List = new Class({
433433
* @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed.
434434
* @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.
435435
*
436-
* @return {Array.<*>} An array of the items which were removed.[description]
436+
* @return {Array.<*>} An array of the items which were removed.
437437
*/
438438
removeBetween: function (startIndex, endIndex, skipCallback)
439439
{

src/structs/Map.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ var Class = require('../utils/Class');
1010
* @callback EachMapCallback
1111
* @generic E - [entry]
1212
*
13-
* @param {string} key - [description]
14-
* @param {*} entry - [description]
13+
* @param {string} key - The key of the Map entry.
14+
* @param {*} entry - The value of the Map entry.
1515
*
16-
* @return {?boolean} [description]
16+
* @return {?boolean} The callback result.
1717
*/
1818

1919
/**

src/structs/ProcessQueue.js

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ var Class = require('../utils/Class');
88

99
/**
1010
* @classdesc
11-
* [description]
11+
* A Process Queue maintains three internal lists.
12+
*
13+
* The `pending` list is a selection of items which are due to be made 'active' in the next update.
14+
* The `active` list is a selection of items which are considered active and should be updated.
15+
* The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update.
16+
*
17+
* When new items are added to a Process Queue they are put in a pending data, rather than being added
18+
* immediately the active list. Equally, items that are removed are put into the destroy list, rather than
19+
* being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed
20+
* time, rather than at the time of the request from the API.
1221
*
1322
* @class ProcessQueue
1423
* @memberof Phaser.Structs
@@ -24,7 +33,7 @@ var ProcessQueue = new Class({
2433
function ProcessQueue ()
2534
{
2635
/**
27-
* [description]
36+
* The `pending` list is a selection of items which are due to be made 'active' in the next update.
2837
*
2938
* @genericUse {T[]} - [$type]
3039
*
@@ -37,7 +46,7 @@ var ProcessQueue = new Class({
3746
this._pending = [];
3847

3948
/**
40-
* [description]
49+
* The `active` list is a selection of items which are considered active and should be updated.
4150
*
4251
* @genericUse {T[]} - [$type]
4352
*
@@ -50,7 +59,7 @@ var ProcessQueue = new Class({
5059
this._active = [];
5160

5261
/**
53-
* [description]
62+
* The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update.
5463
*
5564
* @genericUse {T[]} - [$type]
5665
*
@@ -63,7 +72,7 @@ var ProcessQueue = new Class({
6372
this._destroy = [];
6473

6574
/**
66-
* [description]
75+
* The total number of items awaiting processing.
6776
*
6877
* @name Phaser.Structs.ProcessQueue#_toProcess
6978
* @type {integer}
@@ -75,15 +84,16 @@ var ProcessQueue = new Class({
7584
},
7685

7786
/**
78-
* [description]
87+
* Adds a new item to the Process Queue.
88+
* The item is added to the pending list and made active in the next update.
7989
*
8090
* @method Phaser.Structs.ProcessQueue#add
8191
* @since 3.0.0
8292
*
8393
* @genericUse {T} - [item]
8494
* @genericUse {Phaser.Structs.ProcessQueue.<T>} - [$return]
8595
*
86-
* @param {*} item - [description]
96+
* @param {*} item - The item to add to the queue.
8797
*
8898
* @return {Phaser.Structs.ProcessQueue} This Process Queue object.
8999
*/
@@ -97,15 +107,16 @@ var ProcessQueue = new Class({
97107
},
98108

99109
/**
100-
* [description]
110+
* Removes an item from the Process Queue.
111+
* The item is added to the pending destroy and fully removed in the next update.
101112
*
102113
* @method Phaser.Structs.ProcessQueue#remove
103114
* @since 3.0.0
104115
*
105116
* @genericUse {T} - [item]
106117
* @genericUse {Phaser.Structs.ProcessQueue.<T>} - [$return]
107118
*
108-
* @param {*} item - [description]
119+
* @param {*} item - The item to be removed from the queue.
109120
*
110121
* @return {Phaser.Structs.ProcessQueue} This Process Queue object.
111122
*/
@@ -119,14 +130,17 @@ var ProcessQueue = new Class({
119130
},
120131

121132
/**
122-
* [description]
133+
* Update this queue. First it will process any items awaiting destruction, and remove them.
134+
*
135+
* Then it will check to see if there are any items pending insertion, and move them to an
136+
* active state. Finally, it will return a list of active items for further processing.
123137
*
124138
* @method Phaser.Structs.ProcessQueue#update
125139
* @since 3.0.0
126140
*
127141
* @genericUse {T[]} - [$return]
128142
*
129-
* @return {Array.<*>} [description]
143+
* @return {Array.<*>} A list of active items.
130144
*/
131145
update: function ()
132146
{
@@ -178,28 +192,30 @@ var ProcessQueue = new Class({
178192
},
179193

180194
/**
181-
* [description]
195+
* Returns the current list of active items.
182196
*
183197
* @method Phaser.Structs.ProcessQueue#getActive
184198
* @since 3.0.0
185199
*
186200
* @genericUse {T[]} - [$return]
187201
*
188-
* @return {Array.<*>} [description]
202+
* @return {Array.<*>} A list of active items.
189203
*/
190204
getActive: function ()
191205
{
192206
return this._active;
193207
},
194208

195209
/**
196-
* [description]
210+
* Immediately destroys this process queue, clearing all of its internal arrays and resetting the process totals.
197211
*
198212
* @method Phaser.Structs.ProcessQueue#destroy
199213
* @since 3.0.0
200214
*/
201215
destroy: function ()
202216
{
217+
this._toProcess = 0;
218+
203219
this._pending = [];
204220
this._active = [];
205221
this._destroy = [];

src/structs/Set.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ var Class = require('../utils/Class');
1010
* @callback EachSetCallback
1111
* @generic E - [entry]
1212
*
13-
* @param {*} entry - [description]
14-
* @param {number} index - [description]
13+
* @param {*} entry - The Set entry.
14+
* @param {number} index - The index of the entry within the Set.
1515
*
16-
* @return {?boolean} [description]
16+
* @return {?boolean} The callback result.
1717
*/
1818

1919
/**

src/utils/array/Range.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var BuildChunk = function (a, b, qty)
6363
* @param {array} b - The second array of range elements.
6464
* @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty.
6565
*
66-
* @return {array} [description]
66+
* @return {array} An array of arranged elements.
6767
*/
6868
var Range = function (a, b, options)
6969
{

0 commit comments

Comments
 (0)