class PropPool {
  /** 道具回收池 */
  public pool = []

  private _isEmpyt = true

  /** 是否为空 */
  public get isEmpyt() {
    return !this.pool?.length;
  }

  /** 增加道具回收池道具 */
  public push(prop) {
    prop.active = false
    this.pool.push(prop)
  }

  /** 二次利用道具 */
  public pop() {
    if (this.pool.length === 0) return null
    const prop = this.pool.pop()
    prop.active = true
    return prop
  }
}
export default new PropPool()