local ____lualib = require("lualib_bundle")
local Set = ____lualib.Set
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
local ____entitiesSpecific = require("functions.entitiesSpecific")
local getSlots = ____entitiesSpecific.getSlots
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {room = {initializedSlots = __TS__New(Set)}}
____exports.SlotUpdateDetection = __TS__Class()
local SlotUpdateDetection = ____exports.SlotUpdateDetection
SlotUpdateDetection.name = "SlotUpdateDetection"
__TS__ClassExtends(SlotUpdateDetection, Feature)
function SlotUpdateDetection.prototype.____constructor(self, postSlotInit, postSlotUpdate)
    Feature.prototype.____constructor(self)
    self.v = v
    self.postUpdate = function()
        for ____, slot in ipairs(getSlots(nil)) do
            self:checkNewEntity(slot)
            self.postSlotUpdate:fire(slot)
        end
    end
    self.postNewRoomReordered = function()
        for ____, slot in ipairs(getSlots(nil)) do
            self:checkNewEntity(slot)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_UPDATE, self.postUpdate}}
    self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, self.postNewRoomReordered}}
    self.postSlotInit = postSlotInit
    self.postSlotUpdate = postSlotUpdate
end
function SlotUpdateDetection.prototype.checkNewEntity(self, slot)
    local ptrHash = GetPtrHash(slot)
    if not v.room.initializedSlots:has(ptrHash) then
        v.room.initializedSlots:add(ptrHash)
        self.postSlotInit:fire(slot)
    end
end
return ____exports
