Skip to main content

World

The World is a self-contained entity component system for a particular context.

Index

Constructors

constructor

  • The context type is passed to the system updates


    Parameters

    Returns World

Properties

publicentityManager

entityManager: EntityManager = ...

publicqueryManager

queryManager: QueryManager = ...

publicscene

scene: Scene<unknown>

publicsystemManager

systemManager: SystemManager = ...

Accessors

entities

Methods

add

  • Add an entity to the ECS world


    Parameters

    Returns void

clearEntities

  • clearEntities(): void
  • Returns void

clearSystems

  • clearSystems(): void
  • Returns void

get

query

  • query<TKnownComponentCtors>(requiredTypes: TKnownComponentCtors[]): Query<TKnownComponentCtors>
  • Query the ECS world for entities that match your components


    Type parameters

    Parameters

    • requiredTypes: TKnownComponentCtors[]

    Returns Query<TKnownComponentCtors>

queryTags

  • queryTags<TKnownTags>(requiredTags: TKnownTags[]): TagQuery<TKnownTags>
  • Type parameters

    • TKnownTags: string

    Parameters

    • requiredTags: TKnownTags[]

    Returns TagQuery<TKnownTags>

remove

  • remove(entity: Entity<any>, deferred?: boolean): void
  • remove(system: System): void
  • Remove an entity from the ECS world


    Parameters

    • entity: Entity<any>
    • optionaldeferred: boolean

    Returns void

update

  • Update systems by type and time elapsed in milliseconds


    Parameters

    Returns void