Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ComponentDiff<T>

Type parameters

  • T

Hierarchy

  • ComponentDiff

Constructors

constructor

  • Low level class to get the diff of a ComponentManager.

    Parameters

    • source: ComponentManager<T>

      The ComponentManager to get the diff of.

    • Default value verboose: boolean = true

      Specifies if errors should be thrown when somehing is somewhat wrong.

    Returns ComponentDiff

Properties

Private added

added: Set<number> = new Set<number>()

Added entities since the last reset.

Private changed

changed: Set<number> = new Set<number>()

Changed entities since the last reset.

Private removed

removed: Set<number> = new Set<number>()

Deleted entities since the alst reset.

source

source: ComponentManager<T>

The ComponentManager to get the diff of.

verboose

verboose: boolean

Specifies if errors should be thrown when somehing is somewhat wrong.

Private volatileHandlers

volatileHandlers: Set<function> = new Set<BitFieldEventHandler<number>>()

Handlers to be removed on dispose.

Methods

Private addEntity

  • addEntity(id: number): this
  • Add an entity to the diff.

    Parameters

    • id: number

      The id to add.

    Returns this

Private clean

  • clean(): this
  • Clean inner sets.

    Returns this

collect

  • collect(reset?: boolean): (object | object)[]
  • Collet the diff accumulated. Pass "false" as the first argument to skip reseting. (Next diff will be calculated from the last reset.)

    Parameters

    • Default value reset: boolean = true

      If set to true the inner state will automatically reset.

    Returns (object | object)[]

dispose

  • dispose(): void
  • Remove handlers and clean everything.

    Returns void

Private mutateEntity

  • mutateEntity(id: number): this
  • Mark an entity as changed.

    Parameters

    • id: number

      The id to mark as mutated.

    Returns this

Private removeEntity

  • removeEntity(id: number): this
  • Remove an entity from the diff.

    Parameters

    • id: number

      The id to remove.

    Returns this

Generated using TypeDoc