Skip to content

Home > @esengine/ecs-framework-monorepo > PoolManager

PoolManager class

池管理器 统一管理所有对象池

Signature:

typescript
export declare class PoolManager

Methods

Method

Modifiers

Description

clearAllPools()

清空所有池

compactAllPools()

压缩所有池

createPool(name, createFn, maxSize, estimatedObjectSize)

创建或获取标准池

getAllStats()

获取所有池的统计信息

getGlobalStats()

获取总体统计信息

getInstance()

static

getPool(name)

获取池

getPoolCount()

获取池数量

getPoolNames()

获取所有池名称

getStatsString()

获取格式化的统计信息字符串

prewarmAllPools()

预填充所有池

registerPool(name, pool)

注册池

removePool(name)

移除池

reset()

重置池管理器

setAutoCompactInterval(intervalMs)

设置自动压缩间隔

update()

更新池管理器(应在游戏循环中调用)

基于 MIT 许可证发布