local ____lualib = require("lualib_bundle")
local Map = ____lualib.Map
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 CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {room = {collectibleTypeMap = __TS__New(Map)}}
____exports.PostCollectibleEmpty = __TS__Class()
local PostCollectibleEmpty = ____exports.PostCollectibleEmpty
PostCollectibleEmpty.name = "PostCollectibleEmpty"
__TS__ClassExtends(PostCollectibleEmpty, CustomCallback)
function PostCollectibleEmpty.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = function(____, fireArgs, optionalArgs)
        local _collectible, oldCollectibleType = table.unpack(fireArgs)
        local callbackCollectibleType = table.unpack(optionalArgs)
        return callbackCollectibleType == nil or callbackCollectibleType == oldCollectibleType
    end
    self.postPickupUpdateCollectible = function(____, pickup)
        local collectible = pickup
        local ptrHash = GetPtrHash(collectible)
        local oldCollectibleType = v.room.collectibleTypeMap:get(ptrHash)
        if oldCollectibleType == nil then
            oldCollectibleType = collectible.SubType
        end
        v.room.collectibleTypeMap:set(ptrHash, collectible.SubType)
        if oldCollectibleType ~= collectible.SubType then
            self:collectibleTypeChanged(collectible, oldCollectibleType)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_PICKUP_UPDATE, self.postPickupUpdateCollectible, {PickupVariant.COLLECTIBLE}}}
end
function PostCollectibleEmpty.prototype.collectibleTypeChanged(self, collectible, oldCollectibleType)
    if collectible.SubType == CollectibleType.NULL then
        self:fire(collectible, oldCollectibleType)
    end
end
return ____exports
