Skip to content

Commit

Permalink
Some documentation for the LinkedListContainer.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstart committed Sep 18, 2020
1 parent 2a3e92f commit bce5e4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/LinkedListContainer.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Container, DisplayObject, Renderer, Rectangle, MaskData } from 'pixi.js';

/** Interface for a child of a LinkedListContainer (has the prev/next properties added) */
export interface LinkedListChild extends DisplayObject
{
nextChild: LinkedListChild|null;
prevChild: LinkedListChild|null;
}

/**
* A semi-experimental Container that uses a doubly linked list to manage children instead of an
* array. This means that adding/removing children often is not the same performance hit that
* it would to be continually pushing/splicing.
* However, this is primarily intended to be used for heavy particle usage, and may not handle
* edge cases well if used as a complete Container replacement.
*/
export class LinkedListContainer extends Container
{
private _firstChild: LinkedListChild|null = null;
Expand Down

0 comments on commit bce5e4a

Please sign in to comment.