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 ____shouldFire = require("shouldFire")
local shouldFireProjectile = ____shouldFire.shouldFireProjectile
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {room = {firedSet = __TS__New(Set)}}
____exports.PostProjectileKill = __TS__Class()
local PostProjectileKill = ____exports.PostProjectileKill
PostProjectileKill.name = "PostProjectileKill"
__TS__ClassExtends(PostProjectileKill, CustomCallback)
function PostProjectileKill.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = shouldFireProjectile
    self.postProjectileUpdate = function(____, projectile)
        local ptrHash = GetPtrHash(projectile)
        if projectile:CollidesWithGrid() or projectile:IsDead() then
            v.room.firedSet:add(ptrHash)
        end
    end
    self.preProjectileCollision = function(____, projectile)
        local ptrHash = GetPtrHash(projectile)
        v.room.firedSet:add(ptrHash)
        return nil
    end
    self.postEntityRemove = function(____, entity)
        local projectile = entity:ToProjectile()
        if projectile == nil then
            return
        end
        local ptrHash = GetPtrHash(projectile)
        if v.room.firedSet:has(ptrHash) then
            v.room.firedSet:add(ptrHash)
            self:fire(projectile)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_PROJECTILE_UPDATE, self.postProjectileUpdate}, {ModCallback.PRE_PROJECTILE_COLLISION, self.preProjectileCollision}, {ModCallback.POST_ENTITY_REMOVE, self.postEntityRemove}}
end
return ____exports
