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 __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {room = {preventingEntities = __TS__New(Set)}}
____exports.PreventChildEntities = __TS__Class()
local PreventChildEntities = ____exports.PreventChildEntities
PreventChildEntities.name = "PreventChildEntities"
__TS__ClassExtends(PreventChildEntities, Feature)
function PreventChildEntities.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.v = v
    self.postNPCInit = function(____, npc)
        local spawnerEntityMatch = npc.SpawnerEntity ~= nil and v.room.preventingEntities:has(GetPtrHash(npc.SpawnerEntity))
        local parentMatch = npc.Parent ~= nil and v.room.preventingEntities:has(GetPtrHash(npc.Parent))
        if spawnerEntityMatch or parentMatch then
            npc:Remove()
        end
    end
    self.callbacksUsed = {{ModCallback.POST_NPC_INIT, self.postNPCInit}}
end
function PreventChildEntities.prototype.preventChildEntities(self, entity)
    local ptrHash = GetPtrHash(entity)
    v.room.preventingEntities:add(ptrHash)
end
__TS__DecorateLegacy({Exported}, PreventChildEntities.prototype, "preventChildEntities", true)
return ____exports
