function ZoneController._registerZone(v)registeredZones[v]=true local Y=v.janitor:add(Janitor.new(),"\100\101\115\116\114\111\121")v._registeredJanitor=Y Y:add(v.updated:Connect(function()ZoneController._updateZoneDetails()end),"\068\105\115\099\111\110\110\101\099\116")ZoneController._updateZoneDetails()end function ZoneController._deregisterZone(v)registeredZones[v]=nil v._registeredJanitor:destroy()v._registeredJanitor=nil ZoneController._updateZoneDetails()end function ZoneController._registerConnection(v,Y)local y=dictLength(v.activeTriggers)activeConnections+=1 if y==0 then activeZones[v]=true ZoneController._updateZoneDetails()end local w=activeTriggers[Y]activeTriggers[Y]=w and w+1 or 1 v.activeTriggers[Y]=true if v.touchedConnectionActions[Y]then v:_formTouchedConnection(Y)end if heartbeatActions[Y]then ZoneController._formHeartbeat(Y)end end
-- PRIVATE FUNCTIONS
function ZoneController._registerZone(zone)
	registeredZones[zone] = true
	local registeredJanitor = zone.janitor:add(Janitor.new(), "destroy")
	zone._registeredJanitor = registeredJanitor
	registeredJanitor:add(
		zone.updated:Connect(function()
			ZoneController._updateZoneDetails()
		end),
		"Disconnect"
	)
	ZoneController._updateZoneDetails()
end

function ZoneController._deregisterZone(zone)
	registeredZones[zone] = nil
	zone._registeredJanitor:destroy()
	zone._registeredJanitor = nil
	ZoneController._updateZoneDetails()
end

function ZoneController._registerConnection(registeredZone, registeredTriggerType)
	local originalItems = dictLength(registeredZone.activeTriggers)
	activeConnections += 1
	if originalItems == 0 then
		activeZones[registeredZone] = true
		ZoneController._updateZoneDetails()
	end
	local currentTriggerCount = activeTriggers[registeredTriggerType]
	activeTriggers[registeredTriggerType] = (currentTriggerCount and currentTriggerCount + 1) or 1
	registeredZone.activeTriggers[registeredTriggerType] = true
	if registeredZone.touchedConnectionActions[registeredTriggerType] then
		registeredZone:_formTouchedConnection(registeredTriggerType)
	end
	if heartbeatActions[registeredTriggerType] then
		ZoneController._formHeartbeat(registeredTriggerType)
	end
end
