"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSlotMachine = exports.getSlotName = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const slotNames_1 = require("../objects/slotNames");
const ReadonlySet_1 = require("../types/ReadonlySet");
const entityTypes_1 = require("./entityTypes");
const SLOT_MACHINE_VARIANTS = new ReadonlySet_1.ReadonlySet([
    isaac_typescript_definitions_1.SlotVariant.SLOT_MACHINE,
    isaac_typescript_definitions_1.SlotVariant.BLOOD_DONATION_MACHINE,
    isaac_typescript_definitions_1.SlotVariant.FORTUNE_TELLING_MACHINE,
    isaac_typescript_definitions_1.SlotVariant.DONATION_MACHINE,
    isaac_typescript_definitions_1.SlotVariant.SHOP_RESTOCK_MACHINE,
    isaac_typescript_definitions_1.SlotVariant.GREED_DONATION_MACHINE,
    isaac_typescript_definitions_1.SlotVariant.MOMS_DRESSING_TABLE,
    isaac_typescript_definitions_1.SlotVariant.CRANE_GAME,
    isaac_typescript_definitions_1.SlotVariant.CONFESSIONAL, // 17
]);
/**
 * Helper function to get the name of a slot, as listed in the "entities2.xml" file. Returns
 * "Unknown" if the provided slot variant is not valid.
 *
 * This function only works for vanilla slot variants.
 *
 * For example, `getSlotName(SlotVariant.BLOOD_DONATION_MACHINE)` would return "Blood Donation
 * Machine".
 */
function getSlotName(slotVariant) {
    // Handle modded slots.
    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
    return slotNames_1.SLOT_NAMES[slotVariant] ?? slotNames_1.DEFAULT_SLOT_NAME;
}
exports.getSlotName = getSlotName;
/** Returns true for the specific variants of `EntityType.SLOT` that are machines. */
function isSlotMachine(entity) {
    if (!(0, entityTypes_1.isSlot)(entity)) {
        return false;
    }
    return SLOT_MACHINE_VARIANTS.has(entity.Variant);
}
exports.isSlotMachine = isSlotMachine;
