interface Ennetree<T> {
    size: number;
    bounds: Readonly<Bounds>;
    insert(item: Readonly<T>): void;
    search(area: Readonly<Bounds>): IterableIterator<Readonly<T>>;
    all(): IterableIterator<Readonly<T>>;
    collect(area: Readonly<Bounds>, result?: Readonly<T>[]): Readonly<T>[];
    collectAll(result?: Readonly<T>[]): Readonly<T>[];
    remove(item: Readonly<T>): boolean;
    clear(): void;
}

Type Parameters

  • T

    The type of children of this Ennetree contains.

Properties

size: number

Count the total number of items in the Ennetree.

bounds: Readonly<Bounds>

The bounds of this Ennetree.

Methods

  • Collect items in the Ennetree that intersect with the search area into result.

    Parameters

    • area: Readonly<Bounds>

      The search area of the query.

    • Optionalresult: Readonly<T>[]

      An optional array to collect items. Defaults to an empty array.

    Returns Readonly<T>[]

    A reference to the collection array.

  • Collect all items in the Ennetree into result.

    Parameters

    • Optionalresult: Readonly<T>[]

      An optional array to collect items. Defaults to an empty array.

    Returns Readonly<T>[]

    A reference to the collection array.

  • Clear all items from the Ennetree and reset the tree back to its initial state.

    Returns void