local v=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\118\101\114\109\111\114\101"))local E=v("\080\097\114\116\084\111\117\099\104\105\110\103\067\097\108\099\117\108\097\116\111\114")local F=v("\066\105\110\100\101\114\085\116\105\108")local N=setmetatable({},E)N.ClassName="\066\105\110\100\101\114\084\111\117\099\104\105\110\103\067\097\108\099\117\108\097\116\111\114"N.__index=N function N.new()local v=setmetatable(E.new(),N)return v end function N.GetTouchingClass(Q,v,E,N)local c={}for E,N in pairs(E)do local Q=F.findFirstAncestor(v,N)if Q then if not c[Q]then c[Q]={Object=Q;Touching={N}}else table.insert(c[Q].Touching,N)end end end if N then c[N]=nil end local l={}for v,E in pairs(c)do table.insert(l,E)end return l end return N
--- Extends PartTouchingCalculator with generic binder stuff
-- @classmod BinderTouchingCalculator
-- @author Quenty

local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))

local PartTouchingCalculator = require("PartTouchingCalculator")
local BinderUtil = require("BinderUtil")

local BinderTouchingCalculator = setmetatable({}, PartTouchingCalculator)
BinderTouchingCalculator.ClassName = "BinderTouchingCalculator"
BinderTouchingCalculator.__index = BinderTouchingCalculator

function BinderTouchingCalculator.new()
	local self = setmetatable(PartTouchingCalculator.new(), BinderTouchingCalculator)

	return self
end

function BinderTouchingCalculator:GetTouchingClass(binder, touchingList, ignoreObject)
	local touching = {}

	for _, part in pairs(touchingList) do
		local object = BinderUtil.findFirstAncestor(binder, part)
		if object then
			if not touching[object] then
				touching[object] = {
					Object = object;
					Touching = {
						part
					};
				}
			else
				table.insert(touching[object].Touching, part)
			end
		end
	end

	if ignoreObject then
		touching[ignoreObject] = nil
	end

	local list = {}
	for _, data in pairs(touching) do
		table.insert(list, data)
	end

	return list
end

return BinderTouchingCalculator