create static method

ObjectPool<PoolAble> create(
  1. int withCapacity,
  2. PoolAble object
)

Returns an ObjectPool instance, of a given starting capacity, that recycles instances of a given Poolable object.

@param withCapacity A positive integer value. @param object An instance of the object that the pool should recycle. @return

Implementation

static ObjectPool create(int withCapacity, PoolAble object) {
  ObjectPool result = ObjectPool(withCapacity: withCapacity, object: object);
  result.poolId = ids;
  ids++;

  return result;
}