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 ____players = require("functions.players")
local getClosestPlayer = ____players.getClosestPlayer
local ____shouldFire = require("shouldFire")
local shouldFirePickup = ____shouldFire.shouldFirePickup
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {room = {firedSet = __TS__New(Set)}}
____exports.PostPickupCollect = __TS__Class()
local PostPickupCollect = ____exports.PostPickupCollect
PostPickupCollect.name = "PostPickupCollect"
__TS__ClassExtends(PostPickupCollect, CustomCallback)
function PostPickupCollect.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = shouldFirePickup
    self.postPickupRender = function(____, pickup)
        local sprite = pickup:GetSprite()
        local animation = sprite:GetAnimation()
        if animation ~= "Collect" then
            return
        end
        local index = GetPtrHash(pickup)
        if not v.room.firedSet:has(index) then
            v.room.firedSet:add(index)
            local player = getClosestPlayer(nil, pickup.Position)
            self:fire(pickup, player)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_PICKUP_RENDER, self.postPickupRender}}
end
return ____exports
