-- This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
-- To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
-- or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
local MereHealingFrames, privateVars = ...

MereHealingFrames.HealingPanelFactory = {}

local HealingPanelFactoryBucket = {}

function MereHealingFrames.HealingPanelFactory.NewPanel(ParentLayout, LayoutOffset)
	if #HealingPanelFactoryBucket ~= 0 then
		return table.remove(HealingPanelFactoryBucket)
	else
		return MereHealingFrames.HealingPanel:new({}, ParentLayout, LayoutOffset)
	end
end

function MereHealingFrames.HealingPanelFactory.OldPanel(healingPanel)
	healingPanel:RemoveUnitId()
	return table.insert(HealingPanelFactoryBucket, healingPanel)
end