local ____exports = {}
local ____cachedClasses = require("src.core.cachedClasses")
local game = ____cachedClasses.game
local ____flag = require("src.functions.flag")
local hasFlag = ____flag.hasFlag
--- Helper function to get the actual bit flag for modded curses.
-- 
-- Will throw a run-time error if the provided curse does not exist.
-- 
-- Use this over the `Isaac.GetCurseIdByName` method because that will return an integer instead of
-- a bit flag.
function ____exports.getCurseIDByName(self, name)
    local curseID = Isaac.GetCurseIdByName(name)
    if curseID == -1 then
        error(("Failed to get the curse ID corresponding to the curse name of \"" .. tostring(curseID)) .. "\". Does this name match what you put in the \"content/curses.xml\" file?")
    end
    return 1 << curseID - 1
end
function ____exports.hasCurse(self, curse)
    local level = game:GetLevel()
    local curses = level:GetCurses()
    return hasFlag(nil, curses, curse)
end
return ____exports
