A minimal pool system for Defold.
You can use Defold Pool in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
https://github.com/totebo/defold-pool/archive/master.zip
Or point to the ZIP file of a specific release.
local pool = require "pool.pool"
-- Add items to pool
local id = "test"
for i=1, 100 do
local object = {test="test object"}
pool:add( id,object )
end
-- Remove item from pool
local object = pool:remove( id )
pprint( object )
Adds an object to the pool.
PARAMETERS
idPool id.objectObject to store in pool.
Removes an object to the pool.
PARAMETERS
idPool id.