local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local ____exports = {}
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
local ____rooms = require("functions.rooms")
local inStartingRoom = ____rooms.inStartingRoom
local ____stage = require("functions.stage")
local onFirstFloor = ____stage.onFirstFloor
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {persistent = {pastFirstFloor = false, onRerun = false}}
____exports.RerunDetection = __TS__Class()
local RerunDetection = ____exports.RerunDetection
RerunDetection.name = "RerunDetection"
__TS__ClassExtends(RerunDetection, Feature)
function RerunDetection.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.v = v
    self.postGameStartedReordered = function(____, isContinued)
        if isContinued then
            if onFirstFloor(nil) and inStartingRoom(nil) and v.persistent.pastFirstFloor then
                v.persistent.onRerun = true
            end
        else
            v.persistent.onRerun = false
        end
    end
    self.postNewLevelReordered = function()
        v.persistent.pastFirstFloor = not onFirstFloor(nil)
    end
    self.customCallbacksUsed = {{ModCallbackCustom.POST_GAME_STARTED_REORDERED, self.postGameStartedReordered}, {ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
end
function RerunDetection.prototype.onRerun(self)
    return v.persistent.onRerun
end
__TS__DecorateLegacy({Exported}, RerunDetection.prototype, "onRerun", true)
return ____exports
