Skip to content

Commit 28316ec

Browse files
committed
Merged ProcessQueue docs
1 parent c60530e commit 28316ec

1 file changed

Lines changed: 109 additions & 1 deletion

File tree

src/gameobjects/UpdateList.js

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ var SceneEvents = require('../scene/events');
1818
* Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering.
1919
*
2020
* @class UpdateList
21-
* @extends Phaser.Structs.ProcessQueue
2221
* @memberof Phaser.GameObjects
2322
* @constructor
2423
* @since 3.0.0
@@ -53,6 +52,46 @@ var UpdateList = new Class({
5352
*/
5453
this.systems = scene.sys;
5554

55+
/**
56+
* The `pending` list is a selection of items which are due to be made 'active' in the next update.
57+
*
58+
* @name Phaser.GameObjects.UpdateList#_pending
59+
* @type {Array.<*>}
60+
* @private
61+
* @default []
62+
* @since 3.20.0
63+
*/
64+
65+
/**
66+
* The `active` list is a selection of items which are considered active and should be updated.
67+
*
68+
* @name Phaser.GameObjects.UpdateList#_active
69+
* @type {Array.<*>}
70+
* @private
71+
* @default []
72+
* @since 3.20.0
73+
*/
74+
75+
/**
76+
* The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update.
77+
*
78+
* @name Phaser.GameObjects.UpdateList#_destroy
79+
* @type {Array.<*>}
80+
* @private
81+
* @default []
82+
* @since 3.20.0
83+
*/
84+
85+
/**
86+
* The total number of items awaiting processing.
87+
*
88+
* @name Phaser.GameObjects.UpdateList#_toProcess
89+
* @type {integer}
90+
* @private
91+
* @default 0
92+
* @since 3.0.0
93+
*/
94+
5695
scene.sys.events.once(SceneEvents.BOOT, this.boot, this);
5796
scene.sys.events.on(SceneEvents.START, this.start, this);
5897
},
@@ -177,6 +216,75 @@ var UpdateList = new Class({
177216
this.systems = null;
178217
}
179218

219+
/**
220+
* Adds a new item to the Update List.
221+
*
222+
* The item is added to the pending list and made active in the next update.
223+
*
224+
* @method Phaser.GameObjects.UpdateList#add
225+
* @since 3.0.0
226+
*
227+
* @param {*} item - The item to add to the queue.
228+
*
229+
* @return {*} The item that was added.
230+
*/
231+
232+
/**
233+
* Removes an item from the Update List.
234+
*
235+
* The item is added to the pending destroy and fully removed in the next update.
236+
*
237+
* @method Phaser.GameObjects.UpdateList#remove
238+
* @since 3.0.0
239+
*
240+
* @param {*} item - The item to be removed from the queue.
241+
*
242+
* @return {*} The item that was removed.
243+
*/
244+
245+
/**
246+
* Removes all active items from this Update List.
247+
*
248+
* All the items are marked as 'pending destroy' and fully removed in the next update.
249+
*
250+
* @method Phaser.GameObjects.UpdateList#removeAll
251+
* @since 3.20.0
252+
*
253+
* @return {this} This Update List object.
254+
*/
255+
256+
/**
257+
* Update this queue. First it will process any items awaiting destruction, and remove them.
258+
*
259+
* Then it will check to see if there are any items pending insertion, and move them to an
260+
* active state. Finally, it will return a list of active items for further processing.
261+
*
262+
* @method Phaser.GameObjects.UpdateList#update
263+
* @since 3.0.0
264+
*
265+
* @return {Array.<*>} A list of active items.
266+
*/
267+
268+
/**
269+
* Returns the current list of active items.
270+
*
271+
* This method returns a reference to the active list array, not a copy of it.
272+
* Therefore, be careful to not modify this array outside of the ProcessQueue.
273+
*
274+
* @method Phaser.GameObjects.UpdateList#getActive
275+
* @since 3.0.0
276+
*
277+
* @return {Array.<*>} A list of active items.
278+
*/
279+
280+
/**
281+
* The number of entries in the active list.
282+
*
283+
* @name Phaser.GameObjects.UpdateList#length
284+
* @type {integer}
285+
* @readonly
286+
* @since 3.20.0
287+
*/
180288
});
181289

182290
PluginCache.register('UpdateList', UpdateList, 'updateList');

0 commit comments

Comments
 (0)