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

Method cleanup

packages/core/src/ECS/WorldManager.ts:342–360  ·  view source on GitHub ↗

* 清理空World

()

Source from the content-addressed store, hash-verified

340 * 清理空World
341 */
342 public cleanup(): number {
343 const worldsToRemove: string[] = [];
344
345 for (const [worldName, world] of this._worlds) {
346 if (this.shouldCleanupWorld(world)) {
347 worldsToRemove.push(worldName);
348 }
349 }
350
351 for (const worldName of worldsToRemove) {
352 this.removeWorld(worldName);
353 }
354
355 if (worldsToRemove.length > 0) {
356 logger.debug(`清理了 ${worldsToRemove.length} 个World`);
357 }
358
359 return worldsToRemove.length;
360 }
361
362 /**
363 * 销毁WorldManager

Callers 1

updateAllMethod · 0.95

Calls 4

shouldCleanupWorldMethod · 0.95
removeWorldMethod · 0.95
pushMethod · 0.65
debugMethod · 0.45

Tested by

no test coverage detected