A basic Linked List data structure.
This implementation modifies the prev
and next
properties of each item added:
prev
and next
properties must be writable and should not be used for any other purpose.First element in the list.
Last element in the list.
Next element in the list.
Previous element in the list.
Number of elements in the list.
Adds a new element to this linked list.
Name | Type | Description |
---|---|---|
item | object | The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through. |
The item that was added.
Calls a function on all members of this list, using the member as the context for the callback.
The function must exist on the member.
Name | Type | Description |
---|---|---|
callback | function | The function to call. |
Removes the given element from this linked list if it exists.
Name | Type | Description |
---|---|---|
item | object | The item to be removed from the list. |
Resets the first, last, next and previous node pointers in this list.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.LinkedList.html