World
此内容尚不支持你的语言。
Defined in: world.ts:104
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new World():
World
Returns
Section titled “Returns”World
Properties
Section titled “Properties”changes_
Section titled “changes_”
readonlychanges_:ChangeTracker
Defined in: world.ts:108
queries_
Section titled “queries_”
readonlyqueries_:QueryCache
Defined in: world.ts:109
Accessors
Section titled “Accessors”builtin
Section titled “builtin”Get Signature
Section titled “Get Signature”get builtin():
BuiltinBridge
Defined in: world.ts:118
Returns
Section titled “Returns”hasCpp
Section titled “hasCpp”Get Signature
Section titled “Get Signature”get hasCpp():
boolean
Defined in: world.ts:134
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”advanceTick()
Section titled “advanceTick()”advanceTick():
void
Defined in: world.ts:800
Returns
Section titled “Returns”void
anyChangedSince()
Section titled “anyChangedSince()”anyChangedSince(
component,sinceTick):boolean
Defined in: world.ts:821
True if ANY entity changed component after sinceTick (O(1) gate).
Parameters
Section titled “Parameters”component
Section titled “component”sinceTick
Section titled “sinceTick”number
Returns
Section titled “Returns”boolean
beginIteration()
Section titled “beginIteration()”beginIteration():
void
Defined in: world.ts:330
Returns
Section titled “Returns”void
cleanRemovedBuffer()
Section titled “cleanRemovedBuffer()”cleanRemovedBuffer(
beforeTick):void
Defined in: world.ts:829
Parameters
Section titled “Parameters”beforeTick
Section titled “beforeTick”number
Returns
Section titled “Returns”void
connectCpp()
Section titled “connectCpp()”connectCpp(
cppRegistry,module?,options?):void
Defined in: world.ts:122
Parameters
Section titled “Parameters”cppRegistry
Section titled “cppRegistry”module?
Section titled “module?”options?
Section titled “options?”BridgeConnectOptions
Returns
Section titled “Returns”void
despawn()
Section titled “despawn()”despawn(
entity):void
Defined in: world.ts:204
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
disconnectCpp()
Section titled “disconnectCpp()”disconnectCpp():
void
Defined in: world.ts:130
Returns
Section titled “Returns”void
enableChangeTracking()
Section titled “enableChangeTracking()”enableChangeTracking(
component):void
Defined in: world.ts:808
Parameters
Section titled “Parameters”component
Section titled “component”Returns
Section titled “Returns”void
endIteration()
Section titled “endIteration()”endIteration():
void
Defined in: world.ts:334
Returns
Section titled “Returns”void
entityCount()
Section titled “entityCount()”entityCount():
number
Defined in: world.ts:312
Returns
Section titled “Returns”number
findEntityByName()
Section titled “findEntityByName()”findEntityByName(
name):number|null
Defined in: world.ts:548
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number | null
get<
C>(entity,component):ComponentData<C>
Defined in: world.ts:436
Type Parameters
Section titled “Type Parameters”C extends AnyComponentDef
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”C
Returns
Section titled “Returns”getAllEntities()
Section titled “getAllEntities()”getAllEntities():
number[]
Defined in: world.ts:350
Returns
Section titled “Returns”number[]
getComponentTypes()
Section titled “getComponentTypes()”getComponentTypes(
entity):string[]
Defined in: world.ts:616
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”string[]
getCppRegistry()
Section titled “getCppRegistry()”getCppRegistry():
CppRegistry|null
Defined in: world.ts:138
Returns
Section titled “Returns”CppRegistry | null
getEntitiesWithComponents()
Section titled “getEntitiesWithComponents()”getEntitiesWithComponents(
components,withFilters?,withoutFilters?,precomputedKey?,filter?,precomputedDepIds?):number[]
Defined in: world.ts:676
Parameters
Section titled “Parameters”components
Section titled “components”withFilters?
Section titled “withFilters?”AnyComponentDef[] = []
withoutFilters?
Section titled “withoutFilters?”AnyComponentDef[] = []
precomputedKey?
Section titled “precomputedKey?”string
filter?
Section titled “filter?”QueryFilter
precomputedDepIds?
Section titled “precomputedDepIds?”symbol[]
Returns
Section titled “Returns”number[]
getQueryCacheStats()
Section titled “getQueryCacheStats()”getQueryCacheStats():
QueryCacheStats
Defined in: world.ts:321
Cumulative query-cache counters (hits, misses, invalidation causes).
Returns
Section titled “Returns”QueryCacheStats
getRemovedEntitiesSince()
Section titled “getRemovedEntitiesSince()”getRemovedEntitiesSince(
component,sinceTick):number[]
Defined in: world.ts:825
Parameters
Section titled “Parameters”component
Section titled “component”sinceTick
Section titled “sinceTick”number
Returns
Section titled “Returns”number[]
getWorldTick()
Section titled “getWorldTick()”getWorldTick():
number
Defined in: world.ts:804
Returns
Section titled “Returns”number
getWorldVersion()
Section titled “getWorldVersion()”getWorldVersion():
number
Defined in: world.ts:316
Returns
Section titled “Returns”number
has(
entity,component):boolean
Defined in: world.ts:443
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”Returns
Section titled “Returns”boolean
insert()
Section titled “insert()”insert<
C>(entity,component,data?):ComponentData<C>
Defined in: world.ts:388
Type Parameters
Section titled “Type Parameters”C extends AnyComponentDef
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”C
Partial<ComponentData<C>>
Returns
Section titled “Returns”isAddedSince()
Section titled “isAddedSince()”isAddedSince(
entity,component,sinceTick):boolean
Defined in: world.ts:812
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”sinceTick
Section titled “sinceTick”number
Returns
Section titled “Returns”boolean
isChangedSince()
Section titled “isChangedSince()”isChangedSince(
entity,component,sinceTick):boolean
Defined in: world.ts:816
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”sinceTick
Section titled “sinceTick”number
Returns
Section titled “Returns”boolean
isIterating()
Section titled “isIterating()”isIterating():
boolean
Defined in: world.ts:346
Returns
Section titled “Returns”boolean
isStale()
Section titled “isStale()”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.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”boolean
onDespawn()
Section titled “onDespawn()”onDespawn(
callback): () =>void
Defined in: world.ts:287
Parameters
Section titled “Parameters”callback
Section titled “callback”(entity) => void
Returns
Section titled “Returns”() => void
onSpawn()
Section titled “onSpawn()”onSpawn(
callback): () =>void
Defined in: world.ts:279
Parameters
Section titled “Parameters”callback
Section titled “callback”(entity) => void
Returns
Section titled “Returns”() => void
remove()
Section titled “remove()”remove(
entity,component):void
Defined in: world.ts:477
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”Returns
Section titled “Returns”void
removeParent()
Section titled “removeParent()”removeParent(
entity):void
Defined in: world.ts:369
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
resetIterationDepth()
Section titled “resetIterationDepth()”resetIterationDepth():
void
Defined in: world.ts:342
Returns
Section titled “Returns”void
resetQueryCacheStats()
Section titled “resetQueryCacheStats()”resetQueryCacheStats():
void
Defined in: world.ts:326
Reset the query-cache counters. Entries themselves are kept.
Returns
Section titled “Returns”void
resetQueryPool()
Section titled “resetQueryPool()”resetQueryPool():
void
Defined in: world.ts:612
Returns
Section titled “Returns”void
set<
C>(entity,component,data):void
Defined in: world.ts:395
Type Parameters
Section titled “Type Parameters”C extends AnyComponentDef
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”C
Returns
Section titled “Returns”void
setParent()
Section titled “setParent()”setParent(
child,parent):void
Defined in: world.ts:354
Parameters
Section titled “Parameters”number
parent
Section titled “parent”number
Returns
Section titled “Returns”void
spawn()
Section titled “spawn()”spawn(
name?):number
Defined in: world.ts:151
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number
tryGet()
Section titled “tryGet()”tryGet<
C>(entity,component):ComponentData<C> |null
Defined in: world.ts:454
Type Parameters
Section titled “Type Parameters”C extends AnyComponentDef
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”C
Returns
Section titled “Returns”ComponentData<C> | null
valid()
Section titled “valid()”valid(
entity):boolean
Defined in: world.ts:295
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”boolean