"use strict";
/**
 * This is the type that is fed to the `PRE_ITEM_PICKUP` and `POST_ITEM_PICKUP` custom callbacks.
 *
 * @module
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPickingUpItemTrinket = exports.isPickingUpItemCollectible = exports.isPickingUpItemNull = exports.resetPickingUpItem = exports.newPickingUpItem = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const ReadonlySet_1 = require("./ReadonlySet");
const DEFAULT_ITEM_TYPE = isaac_typescript_definitions_1.ItemType.NULL;
const DEFAULT_SUB_TYPE = isaac_typescript_definitions_1.CollectibleType.NULL;
function newPickingUpItem() {
    return {
        itemType: DEFAULT_ITEM_TYPE,
        subType: DEFAULT_SUB_TYPE,
    };
}
exports.newPickingUpItem = newPickingUpItem;
function resetPickingUpItem(pickingUpItem) {
    pickingUpItem.itemType = DEFAULT_ITEM_TYPE;
    pickingUpItem.subType = DEFAULT_SUB_TYPE;
}
exports.resetPickingUpItem = resetPickingUpItem;
const COLLECTIBLE_ITEM_TYPES = new ReadonlySet_1.ReadonlySet([
    isaac_typescript_definitions_1.ItemType.PASSIVE,
    isaac_typescript_definitions_1.ItemType.ACTIVE,
    isaac_typescript_definitions_1.ItemType.FAMILIAR, // 4
]);
/** Helper function to narrow the type of `PickingUpItem`. */
function isPickingUpItemNull(pickingUpItem) {
    return pickingUpItem.itemType === isaac_typescript_definitions_1.ItemType.NULL;
}
exports.isPickingUpItemNull = isPickingUpItemNull;
/** Helper function to narrow the type of `PickingUpItem`. */
function isPickingUpItemCollectible(pickingUpItem) {
    return COLLECTIBLE_ITEM_TYPES.has(pickingUpItem.itemType);
}
exports.isPickingUpItemCollectible = isPickingUpItemCollectible;
/** Helper function to narrow the type of `PickingUpItem`. */
function isPickingUpItemTrinket(pickingUpItem) {
    return pickingUpItem.itemType === isaac_typescript_definitions_1.ItemType.TRINKET;
}
exports.isPickingUpItemTrinket = isPickingUpItemTrinket;
