Components Interactions Examples Tutorials API FAQ
Options
Menu

Class EntityArray

Array-backed implementation of {EntityStore}

Type parameters

Hierarchy

  • EntityArray

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private _entities

_entities: any

Methods

add

  • add(entity: T): void

entityNearest

  • entityNearest(queryPoint: Point, filter?: function): T
  • Iterates through array of of entities and computes the closest point using the standard Euclidean distance formula.

    Parameters

    • queryPoint: Point
    • Optional filter: function
        • (entity: T): boolean
        • Parameters

          • entity: T

          Returns boolean

    Returns T

map

  • map<S>(callback: function): S[]
  • Type parameters

    • S

    Parameters

    • callback: function
        • (value: T): S
        • Parameters

          • value: T

          Returns S

    Returns S[]

Generated using TypeDoc