Class ListIteratingSystem<TNode>Abstract

A useful class for systems which simply iterate over a set of nodes, performing the same action on each node. This class removes the need for a lot of boilerplate code in such systems. Extend this class and implement update method. The node update method will be called once per node on the update cycle with the node instance and the frame time as parameters. e.g.

Example

export class MySystem extends ListIteratingSystem<MyNode> {
constructor() {
super(MyNode);
}

updateNode(node:MyNode, time:number):void {
// process the node here
}
}

Type Parameters

  • TNode extends Node

    Node type to be processed by this System.

Hierarchy

Constructors

Properties

next: null | ListIteratingSystem<TNode> = null

Used internally to manage the list of systems within the engine. The next system in the list.

nodeAdded?: ((node) => void)

Type declaration

    • (node): void
    • When you implement this callback it will be called whenever a new Node is added to the NodeList of this System

      Parameters

      • node: TNode

      Returns void

nodeClass: NodeClass<TNode>
nodeList: NodeList<TNode>
nodeRemoved?: ((node) => void)

Type declaration

    • (node): void
    • When you implement this callback it will be called whenever a Node is removed from the NodeList of this System

      Parameters

      • node: TNode

      Returns void

previous: null | ListIteratingSystem<TNode> = null

Used internally to manage the list of systems within the engine. The previous system in the list.

priority: number = 0

Used internally to hold the priority of this system within the system list. This is used to order the systems so they are updated in the correct order.

Methods

Generated using TypeDoc