function Database._Parse_R(g,o,B,u)u=u and u or 0 local W={}if u>0 then W={id=u+1}g[o.name]=W end local I=o:GetAttributes()for g,o in pairs(I)do W[g]=o end for o,B in ipairs(o:GetChildren())do if B.ClassName=="\070\111\108\100\101\114"then u=u+1 Database._Parse_R(g,B,W,u)else W[B.name]=B end end end return Database

function Database._Parse_R(dataRoot,rootFolder,data,_id)
	
	_id = _id and _id or 0
	local initialTable = {}
	
	-- Ignore the first folder which is our root
	if _id > 0 then
		initialTable = { ["id"] = _id + 1 }
		dataRoot[rootFolder.name] = initialTable -- Store by Name
	end

    -- Store attributes
    local attributes = rootFolder:GetAttributes()
    for name, value in pairs(attributes) do
		initialTable[name] = value
	end

    -- Recursively parse every child that is a folder
    for _, child in ipairs(rootFolder:GetChildren()) do
        -- Recursively parse the folders only
		if child.ClassName == "Folder" then
			_id = _id + 1
			Database._Parse_R(dataRoot,child,initialTable,_id)
        else
            -- If it's not a folder then store it as a reference
			initialTable[child.name] = child
        end
	end
	

end

return Database
