Components Interactions Examples Tutorials API FAQ
Options
Menu

Interface EntityStore

EntityStore stores entities and makes them searchable. Valid entities must be positioned in Cartesian space.

Type parameters

Hierarchy

  • EntityStore

Implemented by

Index

Methods

add

  • add(entity: T): void
  • Adds an entity to the store

    Parameters

    • entity: T

    Returns void

entityNearest

  • entityNearest(point: Point, filter?: function): T
  • Returns closest entity to a given {Point}

    Parameters

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

          • entity: T

          Returns boolean

    Returns T

    Will return the nearest entity or undefined if none are found

map

  • map<S>(callback: function): S[]
  • Iterator that loops through entities and returns a transformed array

    Type parameters

    • S

    Parameters

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

          • value: T

          Returns S

    Returns S[]

    The aggregate result of each call to the transformation function

Generated using TypeDoc