function DataStoreStage.GetNewWriter(m)local U=DataStoreWriter.new()if m._dataToSave then U:SetRawData(m._dataToSave)end for m,q in pairs(m._stores)do if not q.Destroy then warn(("\091\068\097\116\097\083\116\111\114\101\083\116\097\103\101\093 - \083\117\098\115\116\111\114\101 \037\113 \100\101\115\116\114\111\121\101\100"):format(m))continue end if q:HasWritableData()then U:AddWriter(m,q:GetNewWriter())end end return U end
--[=[
	Constructs a writer which provides a snapshot of the current data state to write
	@return DataStoreWriter
]=]
function DataStoreStage:GetNewWriter()
	local writer = DataStoreWriter.new()
	if self._dataToSave then
		writer:SetRawData(self._dataToSave)
	end

	for name, store in pairs(self._stores) do
		if not store.Destroy then
			warn(("[DataStoreStage] - Substore %q destroyed"):format(name))
			continue
		end

		if store:HasWritableData() then
			writer:AddWriter(name, store:GetNewWriter())
		end
	end

	return writer
end
