"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostPlayerInitLate = void 0;
const ModCallbackCustom_1 = require("../../enums/ModCallbackCustom");
const playerDataStructures_1 = require("../../functions/playerDataStructures");
const shouldFire_1 = require("../../shouldFire");
const CustomCallback_1 = require("../private/CustomCallback");
const v = {
    run: {
        playersFiredSet: new Set(),
    },
};
class PostPlayerInitLate extends CustomCallback_1.CustomCallback {
    v = v;
    constructor() {
        super();
        this.customCallbacksUsed = [
            [
                ModCallbackCustom_1.ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED,
                this.postPEffectUpdateReordered,
            ],
        ];
    }
    shouldFire = shouldFire_1.shouldFirePlayer;
    // ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED
    postPEffectUpdateReordered = (player) => {
        if (!(0, playerDataStructures_1.setHasPlayer)(v.run.playersFiredSet, player)) {
            (0, playerDataStructures_1.setAddPlayer)(v.run.playersFiredSet, player);
            this.fire(player);
        }
    };
}
exports.PostPlayerInitLate = PostPlayerInitLate;
