local k={}local c={}local O=require(script.Parent.modules.t)local M=require(script.Parent.utilities.logger)local t=require(script.Parent.effectsMap)local S=require(script.Parent.baseEffect)local w=O.interface({Unreliable=O.optional(O.boolean)})function methodGuard(k)for c,O in t.getAll()do for c,O in O do if k~=O then continue end if rawget(S,c)then return false end return true end end return false end local E={Unrealiable=false}function k.Configure(k,O)M.assert(w(O),"\080\114\111\118\105\100\101\100 \099\111\110\102\105\103 \099\111\110\116\097\105\110\115 \105\110\118\097\108\105\100 \118\097\108\117\101\115\046")M.assert(methodGuard(k),"\080\114\111\118\105\100\101\100 \109\101\116\104\111\100 \105\115 \110\111\116 \097 \118\097\108\105\100 \101\102\102\101\099\116 \109\101\116\104\111\100")c[k]=O end function k.Config(k)M.assert(w(k),"\080\114\111\118\105\100\101\100 \099\111\110\102\105\103 \099\111\110\116\097\105\110\115 \105\110\118\097\108\105\100 \118\097\108\117\101\115\046")return function(O)M.assert(methodGuard(O),"\080\114\111\118\105\100\101\100 \109\101\116\104\111\100 \105\115 \110\111\116 \097 \118\097\108\105\100 \101\102\102\101\099\116 \109\101\116\104\111\100")c[O]=k end end function k.GetConfig(k)return c[k]or E end return k
local configuration = {}
local configs = {}

local t = require(script.Parent.modules.t)
local logger = require(script.Parent.utilities.logger)
local map = require(script.Parent.effectsMap)
local baseEffect = require(script.Parent.baseEffect)

local configGuard = t.interface({
	Unreliable = t.optional(t.boolean),
})

function methodGuard(methodToCheck)
	for _, ctor in map.getAll() do
		for name, method in ctor do
			if methodToCheck ~= method then
				continue
			end
			if rawget(baseEffect, name) then
				return false
			end

			return true
		end
	end

	return false
end

local defaultConfig = {
	Unrealiable = false,
}
function configuration.Configure(method, config)
	logger.assert(configGuard(config), "Provided config contains invalid values.")
	logger.assert(methodGuard(method), "Provided method is not a valid effect method")

	configs[method] = config
end

function configuration.Config(config)
	logger.assert(configGuard(config), "Provided config contains invalid values.")
	return function(method)
		logger.assert(methodGuard(method), "Provided method is not a valid effect method")
		configs[method] = config
	end
end

function configuration.GetConfig(method)
	return configs[method] or defaultConfig
end

return configuration
