local s="\077\097\105\100 \100\111\101\115 \110\111\116 \115\117\112\112\111\114\116 \116\121\112\101 \"\037\115\""local Q={["\102\117\110\099\116\105\111\110"]=function(s)s()end,RBXScriptConnection=function(s)s:Disconnect()end;Instance=function(s)s:Destroy()end;table=function(s)s:Destroy()end}local a={}a.__index=a a.ClassName="\077\097\105\100"function a.new()local s=setmetatable({},a)s.Trash={}return s end function a.Mark(i,a)local q=typeof(a)if Q[q]then i.Trash[a]=q else error(s:format(q),2)end end function a.Unmark(Q,s)if s then Q.Trash[s]=nil else Q.Trash={}end end function a.Sweep(s)for s,a in next,s.Trash do Q[a](s)end s.Trash={}end return a
-- CONSTANTS

local FORMAT_STR = "Maid does not support type \"%s\""

local DESTRUCTORS = {
	["function"] = function(item)
		item()
	end;
	["RBXScriptConnection"] = function(item)
		item:Disconnect()
	end;
	["Instance"] = function(item)
		item:Destroy()
	end;
	["table"] = function(item)
		item:Destroy()
	end;
}

-- Class

local MaidClass = {}
MaidClass.__index = MaidClass
MaidClass.ClassName = "Maid"

-- Public Constructors

function MaidClass.new()
	local self = setmetatable({}, MaidClass)
	
	self.Trash = {}
	
	return self
end

-- Public Methods

function MaidClass:Mark(item)
	local tof = typeof(item)
	
	if (DESTRUCTORS[tof]) then
		self.Trash[item] = tof
	else
		error(FORMAT_STR:format(tof), 2)
	end
end

function MaidClass:Unmark(item)
	if (item) then
		self.Trash[item] = nil
	else
		self.Trash = {}
	end
end

function MaidClass:Sweep()
	for item, tof in next, self.Trash do
		DESTRUCTORS[tof](item)
	end
	self.Trash = {}
end

--

return MaidClass