"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostNPCInitLate = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const shouldFire_1 = require("../../shouldFire");
const CustomCallback_1 = require("../private/CustomCallback");
const v = {
    room: {
        firedSet: new Set(),
    },
};
class PostNPCInitLate extends CustomCallback_1.CustomCallback {
    v = v;
    constructor() {
        super();
        this.callbacksUsed = [
            // 0
            [isaac_typescript_definitions_1.ModCallback.POST_NPC_UPDATE, this.postNPCUpdate],
        ];
    }
    shouldFire = shouldFire_1.shouldFireNPC;
    // ModCallback.POST_NPC_UPDATE (0)
    postNPCUpdate = (npc) => {
        const index = GetPtrHash(npc);
        if (!v.room.firedSet.has(index)) {
            v.room.firedSet.add(index);
            this.fire(npc);
        }
    };
}
exports.PostNPCInitLate = PostNPCInitLate;
