@game-vir/entity - v15.1.1
    Preparing search index...

    Class EntityStore<Context, RegisteredEntities>

    The top level storage class of all entities. Add entities with EntityStore.addEntity.

    Type Parameters

    Index

    Constructors

    Properties

    context: Context

    Context given to all entities. This can be undefined.

    currentEntityInstances: Set<BaseEntity<any, any, never>> = ...

    All current child entities.

    Instead of modifying this set, use EntityStore.addEntity or EntityStore.removeEntity. If you must manually modify this set directly, you'll also need to modify EntityStore.entityInstanceMap.

    entityInstanceMap: ConstructorMap = ...

    An internal mapping of all entity constructors to their current instances.

    entityKeyConstructorMap: Record<
        string,
        Constructor<BaseEntity<any, any, never>> & Pick<
            typeof BaseEntity,
            "deserialize"
            | "entityKey",
        >,
    >

    A map of all entity keys to their registered Entity constructors.

    events: ListenTarget<
        EntityDestroyEvent
        | ExtractEntityEvents<RegisteredEntities>,
    > = ...

    Events emitted from any child entities.

    hitboxSystem: System

    Collision detection system.

    isDestroyed: boolean = false

    If true, this entity store should no longer be used or operated upon.

    pixi: Application

    Original pixi app.

    Methods

    • Get all current instances of the given entity class constructor.

      Type Parameters

      • T

      Parameters

      • entityClassConstructor: AbstractConstructor<T> | Constructor<T>

      Returns Set<T>

    • Runs .update() on all current entities and runs collision detection for all hitboxes. If any entities get marked as destroyed during their update, then they will be removed from the set of entities.

      Returns void

      All detected hitbox collisions (if any).