Skip to content

World

Defined in: world.ts:104

new World(): World

World

readonly changes_: ChangeTracker

Defined in: world.ts:108


readonly queries_: QueryCache

Defined in: world.ts:109

get builtin(): BuiltinBridge

Defined in: world.ts:118

BuiltinBridge


get hasCpp(): boolean

Defined in: world.ts:134

boolean

advanceTick(): void

Defined in: world.ts:800

void


anyChangedSince(component, sinceTick): boolean

Defined in: world.ts:821

True if ANY entity changed component after sinceTick (O(1) gate).

AnyComponentDef

number

boolean


beginIteration(): void

Defined in: world.ts:330

void


cleanRemovedBuffer(beforeTick): void

Defined in: world.ts:829

number

void


connectCpp(cppRegistry, module?, options?): void

Defined in: world.ts:122

CppRegistry

ESEngineModule

BridgeConnectOptions

void


despawn(entity): void

Defined in: world.ts:204

number

void


disconnectCpp(): void

Defined in: world.ts:130

void


enableChangeTracking(component): void

Defined in: world.ts:808

AnyComponentDef

void


endIteration(): void

Defined in: world.ts:334

void


entityCount(): number

Defined in: world.ts:312

number


findEntityByName(name): number | null

Defined in: world.ts:548

string

number | null


get<C>(entity, component): ComponentData<C>

Defined in: world.ts:436

C extends AnyComponentDef

number

C

ComponentData<C>


getAllEntities(): number[]

Defined in: world.ts:350

number[]


getComponentTypes(entity): string[]

Defined in: world.ts:616

number

string[]


getCppRegistry(): CppRegistry | null

Defined in: world.ts:138

CppRegistry | null


getEntitiesWithComponents(components, withFilters?, withoutFilters?, precomputedKey?, filter?, precomputedDepIds?): number[]

Defined in: world.ts:676

AnyComponentDef[]

AnyComponentDef[] = []

AnyComponentDef[] = []

string

QueryFilter

symbol[]

number[]


getQueryCacheStats(): QueryCacheStats

Defined in: world.ts:321

Cumulative query-cache counters (hits, misses, invalidation causes).

QueryCacheStats


getRemovedEntitiesSince(component, sinceTick): number[]

Defined in: world.ts:825

AnyComponentDef

number

number[]


getWorldTick(): number

Defined in: world.ts:804

number


getWorldVersion(): number

Defined in: world.ts:316

number


has(entity, component): boolean

Defined in: world.ts:443

number

AnyComponentDef

boolean


insert<C>(entity, component, data?): ComponentData<C>

Defined in: world.ts:388

C extends AnyComponentDef

number

C

Partial<ComponentData<C>>

ComponentData<C>


isAddedSince(entity, component, sinceTick): boolean

Defined in: world.ts:812

number

AnyComponentDef

number

boolean


isChangedSince(entity, component, sinceTick): boolean

Defined in: world.ts:816

number

AnyComponentDef

number

boolean


isIterating(): boolean

Defined in: world.ts:346

boolean


isStale(entity): boolean

Defined in: world.ts:305

True if entity refers to a slot that has been recycled — its index is currently live, but held by a different generation. Useful for diagnostic logs: valid() alone can’t distinguish “never existed” from “was despawned and its slot reassigned” since both return false.

number

boolean


onDespawn(callback): () => void

Defined in: world.ts:287

(entity) => void

() => void


onSpawn(callback): () => void

Defined in: world.ts:279

(entity) => void

() => void


remove(entity, component): void

Defined in: world.ts:477

number

AnyComponentDef

void


removeParent(entity): void

Defined in: world.ts:369

number

void


resetIterationDepth(): void

Defined in: world.ts:342

void


resetQueryCacheStats(): void

Defined in: world.ts:326

Reset the query-cache counters. Entries themselves are kept.

void


resetQueryPool(): void

Defined in: world.ts:612

void


set<C>(entity, component, data): void

Defined in: world.ts:395

C extends AnyComponentDef

number

C

ComponentData<C>

void


setParent(child, parent): void

Defined in: world.ts:354

number

number

void


spawn(name?): number

Defined in: world.ts:151

string

number


tryGet<C>(entity, component): ComponentData<C> | null

Defined in: world.ts:454

C extends AnyComponentDef

number

C

ComponentData<C> | null


valid(entity): boolean

Defined in: world.ts:295

number

boolean