# Class: LinkedList

## Phaser. LinkedList

Phaser.LinkedList

#### new LinkedList()

  A basic linked list data structure.

  Source:
    - core/LinkedList.js, line 13

### Members

#### first

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `first` | object | First element in the list.

  Default Value:
    - null
  Source:
    - core/LinkedList.js, line 31

#### last

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `last` | object | Last element in the list.

  Default Value:
    - null
  Source:
    - core/LinkedList.js, line 37

#### next

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `next` | object | Next element in the list.

  Default Value:
    - null
  Source:
    - core/LinkedList.js, line 19

#### prev

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `prev` | object | Previous element in the list.

  Default Value:
    - null
  Source:
    - core/LinkedList.js, line 25

#### total

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `total` | number | Number of elements in the list.

  Default Value:
    - 0
  Source:
    - core/LinkedList.js, line 43

### Methods

#### add(child) → {object}

  Adds a new element to this linked list.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `child` | object | The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through.

  Source:
    - core/LinkedList.js, line 49

  ##### Returns:

  The child that was added.

  Type
    object

#### 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:
    - core/LinkedList.js, line 146

#### remove(child)

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

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `child` | object | The child to be removed from the list.

  Source:
    - core/LinkedList.js, line 97

#### reset()

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

  Source:
    - core/LinkedList.js, line 82