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

Method toArray

packages/core/src/ECS/Core/Query/CompiledQuery.ts:262–270  ·  view source on GitHub ↗

* 转换为数组 * * Convert to array. * * @returns 实体和组件元组数组 | Array of entity and components tuples

()

Source from the content-addressed store, hash-verified

260 * @returns 实体和组件元组数组 | Array of entity and components tuples
261 */
262 public toArray(): Array<[Entity, ...InstanceTypes<T>]> {
263 const result: Array<[Entity, ...InstanceTypes<T>]> = [];
264
265 this.forEach((entity, ...components) => {
266 result.push([entity, ...components]);
267 });
268
269 return result;
270 }
271
272 /**
273 * 映射转换

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.95
pushMethod · 0.65

Tested by

no test coverage detected