MCPcopy Index your code
hub / github.com/esengine/esengine / map

Method map

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

* 映射集合中的所有元素 * * @param callback 映射回调函数 * @returns 映射后的新数组

(callback: (item: T, index: number) => U)

Source from the content-addressed store, hash-verified

151 * @returns 映射后的新数组
152 */
153 public map<U>(callback: (item: T, index: number) => U): U[] {
154 const result: U[] = [];
155 for (let i = 0; i < this._dense.length; i++) {
156 result.push(callback(this._dense[i]!, i));
157 }
158 return result;
159 }
160
161 /**
162 * 过滤集合中的元素

Callers 15

applyTilemapDataMethod · 0.45
exportToDataMethod · 0.45
convertMethod · 0.45
convertTilesetMethod · 0.45
convertTileDataMethod · 0.45
convertToJsonMethod · 0.45
handleGlobalMouseMoveFunction · 0.45
GradientEditorFunction · 0.45
PropertySelectFunction · 0.45
BurstPropertiesFunction · 0.45
ParticleEditorPanelFunction · 0.45
TilemapCanvasFunction · 0.45

Calls 2

callbackFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected