MCPcopy Create free account
hub / github.com/esengine/esengine / getIndex

Method getIndex

packages/core/src/ECS/Utils/SparseSet.ts:105–107  ·  view source on GitHub ↗

* 获取元素在密集数组中的索引 * * @param item 要查询的元素 * @returns 索引,如果元素不存在则返回undefined

(item: T)

Source from the content-addressed store, hash-verified

103 * @returns 索引,如果元素不存在则返回undefined
104 */
105 public getIndex(item: T): number | undefined {
106 return this._sparse.get(item);
107 }
108
109 /**
110 * 根据索引获取元素

Callers 5

addEntityMethod · 0.45
removeEntityMethod · 0.45
hasComponentMethod · 0.45
getEntityMaskMethod · 0.45
SparseSet.test.tsFile · 0.45

Calls 1

getMethod · 0.65

Tested by

no test coverage detected