Phaser. LinkedList

new LinkedList()

A basic Linked List data structure.

This implementation modifies the prev and next properties of each item added:

  • The prev and next properties must be writable and should not be used for any other purpose.
  • Items cannot be added to multiple LinkedLists at the same time.
  • Only objects can be added.
Source - utils/LinkedList.js, line 18

Members

first :object

First element in the list.

Source - utils/LinkedList.js, line 39

last :object

Last element in the list.

Source - utils/LinkedList.js, line 46

next :object

Next element in the list.

Source - utils/LinkedList.js, line 25

prev :object

Previous element in the list.

Source - utils/LinkedList.js, line 32

total :integer

Number of elements in the list.

Source - utils/LinkedList.js, line 53

Methods

add(item) → {object}

Adds a new element to this linked list.

Parameters:
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.

Returns:
object -

The item that was added.

Source - utils/LinkedList.js, line 59

callAll(callback)

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.

Parameters:
Name Type Description
callback function

The function to call.

Source - utils/LinkedList.js, line 156

remove(item)

Removes the given element from this linked list if it exists.

Parameters:
Name Type Description
item object

The item to be removed from the list.

Source - utils/LinkedList.js, line 107

reset()

Resets the first, last, next and previous node pointers in this list.

Source - utils/LinkedList.js, line 92
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.2 on Thu Feb 18 2016 14:41:03 GMT+0000 (GMT Standard Time) using the DocStrap template.

快捷菜单

注意:只有登录才能全文翻译,每个新用户赠送300会员币。
赚取方法:文章评论+1000,分享网站截图给站长+3000,另充10元+100万会员币
支持一下记得截图给站长!

VIP限时免费阅读!登录可得1万币尽情中文阅读!


记得CTRL+D收藏!
站长微信:
支持自学php网
如有问题,记得强刷一下.

  • first :object - 属性
  • last :object - 属性
  • next :object - 属性
  • prev :object - 属性
  • total :integer - 属性
  • add(item) → {object} - 方法
  • callAll(callback) - 方法
  • remove(item) - 方法
  • reset() - 方法