local PrefabObject = require "app/bf/unity/uiprefab_object"

local CellManager = {}

function CellManager:loadCellAsync(path, cellComp, parent, callback)
    UIPrefabManager:loadUIWidgetAsync(path, parent, function(prefab)
        local cell = self:addCellComp(prefab, cellComp)
        if callback then
            callback(cell)
        end
    end)
end

function CellManager:addCellComp(prefab, type)
    prefab:initPrefabHelper()
    prefab:genAllChildren()
    return prefab:addLuaComponent(type)
end

return CellManager
