local K={logFailedPredicates=false;typeChecking=true;guaranteedRollWeight=-1}local N={}for K,y in pairs(K)do N[K]=y end local y={}function y.get(K)return N[K]end function y.set(y)for y,l in y do if K[y]==nil then error(string.format("\065\116\116\101\109\112\116\101\100 \116\111 \115\101\116 \105\110\118\097\108\105\100 \099\111\110\102\105\103 \107\101\121\058 \037\115",y),2)end if typeof(l)~=typeof(K[y])then error(string.format("\065\116\116\101\109\112\116\101\100 \116\111 \115\101\116 \099\111\110\102\105\103 \107\101\121 \037\113 \119\105\116\104 \105\110\118\097\108\105\100 \116\121\112\101\058 \037\113\046 \069\120\112\101\099\116\101\100 \116\121\112\101 \037\113",y,typeof(l),typeof(K[y])),2)end N[y]=l end end return y
--[=[
    @class Config

    The configuration settings for Looty
]=]

--[=[
    @interface Configuration
    @within Config

    :::warning
    Setting `guaranteedRollWeight` to anything below zero will result in Looty throwing an error.
    :::

    .logFailedPredicates boolean -- Logs predicates that fail on loot pools, as well as individual items.
    .typeChecking boolean -- `true` if you want type checking to be enabled. This is on by default.
    .guaranteedRollWeight number -- The number that specifies what weight should be considered as a guaranteed item. The default is -1.
]=]

local defaultConfiguration = {
    logFailedPredicates = false,
    typeChecking = true,
    guaranteedRollWeight = -1,
}

local configuration = {}
for key, value in pairs(defaultConfiguration) do
    configuration[key] = value
end

local Config = {}

--[=[
    @within Config
    @function get
    @param name string -- The name of the config
    @return boolean | number

    Returns the current value of a specified configuration
]=]

function Config.get(name)
    return configuration[name]
end

--[=[
    @within Config
    @function set
    @param values {[string]: boolean} -- The configurations you want to change

    Changes the current configuration values to the newly specified ones.
]=]
function Config.set(values)
    for key, value in values do
        if defaultConfiguration[key] == nil then
            error(string.format("Attempted to set invalid config key: %s", key), 2)
        end

        if typeof(value) ~= typeof(defaultConfiguration[key]) then
            error(string.format("Attempted to set config key %q with invalid type: %q. Expected type %q", key, typeof(value), typeof(defaultConfiguration[key])), 2)
        end

        configuration[key] = value
    end
end

return Config