/// <summary> /// Create a new pool for the model /// The model has to be new, its instanceId will /// be used to create a dictionary entry /// </summary> /// <param name="model">the model of the pool</param> /// <param name="poolSize">The number of element in the pool</param> /// <param name="expandSize">By how many the pool has to increase</param> /// <returns>The new pool</returns> public UnityPool AddPool(UnityPoolObject model, uint poolSize, uint expandSize = 1) { UnityPool newPool = InstanciatePool(model, expandSize); newPool.SetSize(poolSize); _table.Add(model.GetInstanceID(), newPool); return(newPool); }
/// <summary> /// Check if there is already a pool with this model /// </summary> /// <param name="model"></param> /// <returns>True if there is one pool with this model, false otherwise</returns> public bool Contains(UnityPoolObject model) { return(_table.ContainsKey(model.GetInstanceID())); }