local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
local ____cachedClasses = require("core.cachedClasses")
local game = ____cachedClasses.game
local ____constants = require("core.constants")
local DIMENSIONS = ____constants.DIMENSIONS
local ____roomData = require("functions.roomData")
local getRoomGridIndex = ____roomData.getRoomGridIndex
--- Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
-- but it can change if e.g. the player is in the mirror world of Downpour/Dross.
function ____exports.getDimension(self)
    local level = game:GetLevel()
    local roomGridIndex = getRoomGridIndex(nil)
    local roomDescription = level:GetRoomByIdx(roomGridIndex, Dimension.CURRENT)
    local currentRoomHash = GetPtrHash(roomDescription)
    for ____, dimension in ipairs(DIMENSIONS) do
        local dimensionRoomDescription = level:GetRoomByIdx(roomGridIndex, dimension)
        local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
        if dimensionRoomHash == currentRoomHash then
            return dimension
        end
    end
    error("Failed to get the current dimension.")
end
function ____exports.inDimension(self, dimension)
    return dimension == ____exports.getDimension(nil)
end
return ____exports
