"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnTrinketWithSeed = exports.spawnTrinket = exports.spawnSackWithSeed = exports.spawnSack = exports.spawnPillWithSeed = exports.spawnPill = exports.spawnKeyWithSeed = exports.spawnKey = exports.spawnHeartWithSeed = exports.spawnHeart = exports.spawnCoinWithSeed = exports.spawnCoin = exports.spawnCardWithSeed = exports.spawnCard = exports.spawnBombPickupWithSeed = exports.spawnBombPickup = exports.spawnBatteryWithSeed = exports.spawnBattery = exports.removeAllTrinkets = exports.removeAllSacks = exports.removeAllPills = exports.removeAllKeys = exports.removeAllHearts = exports.removeAllCollectibles = exports.removeAllCoins = exports.removeAllChests = exports.removeAllCards = exports.removeAllBombPickups = exports.removeAllBatteries = exports.getTrinkets = exports.getSacks = exports.getPills = exports.getKeys = exports.getHearts = exports.getCollectibles = exports.getCoins = exports.getChests = exports.getCards = exports.getBombPickups = exports.getBatteries = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const constants_1 = require("../core/constants");
const entities_1 = require("./entities");
const entitiesSpecific_1 = require("./entitiesSpecific");
/**
 * Helper function to get all of the battery entities in the room.
 *
 * @param batterySubType Optional. If specified, will only get the batteries that match the
 *                       sub-type. Default is -1, which matches every sub-type.
 */
function getBatteries(batterySubType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.LIL_BATTERY, batterySubType);
}
exports.getBatteries = getBatteries;
/**
 * Helper function to get all of the bomb entities in the room. (Specifically, this refers to bomb
 * pickups, not the `EntityBomb` class.)
 *
 * @param bombSubType Optional. If specified, will only get the bombs that match the sub-type.
 *                    Default is -1, which matches every sub-type.
 */
function getBombPickups(bombSubType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.BOMB, bombSubType);
}
exports.getBombPickups = getBombPickups;
/**
 * Helper function to get all of the card entities in the room.
 *
 * @param cardType Optional. If specified, will only get the cards that match the sub-type. Default
 *                 is -1, which matches every sub-type.
 */
function getCards(cardType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.CARD, cardType);
}
exports.getCards = getCards;
/**
 * Helper function to get all of the chest entities in the room. Specifically, this is all of the
 * pickups with a variant in the `CHEST_PICKUP_VARIANTS` constant.
 *
 * @param subType Optional. If specified, will only get the chests that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getChests(subType = -1) {
    const chests = [];
    for (const pickupVariant of constants_1.CHEST_PICKUP_VARIANTS) {
        const pickups = (0, entitiesSpecific_1.getPickups)(pickupVariant, subType);
        chests.push(...pickups);
    }
    return chests;
}
exports.getChests = getChests;
/**
 * Helper function to get all of the coin pickup entities in the room.
 *
 * @param coinSubType Optional. If specified, will only get the coins that match the sub-type.
 *                    Default is -1, which matches every sub-type.
 */
function getCoins(coinSubType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.COIN, coinSubType);
}
exports.getCoins = getCoins;
/**
 * Helper function to get all of the collectible entities in the room.
 *
 * @param collectibleType Optional. If specified, will only get the collectibles that match the
 *                        sub-type. Default is -1, which matches every sub-type.
 */
function getCollectibles(collectibleType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.COLLECTIBLE, collectibleType);
}
exports.getCollectibles = getCollectibles;
/**
 * Helper function to get all of the heart pickup entities in the room.
 *
 * @param heartSubType Optional. If specified, will only get the hearts that match the sub-type.
 *                     Default is -1, which matches every sub-type.
 */
function getHearts(heartSubType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.HEART, heartSubType);
}
exports.getHearts = getHearts;
/**
 * Helper function to get all of the key pickup entities in the room.
 *
 * @param keySubType Optional. If specified, will only get the keys that match the sub-type. Default
 *                   is -1, which matches every sub-type.
 */
function getKeys(keySubType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.KEY, keySubType);
}
exports.getKeys = getKeys;
/**
 * Helper function to get all of the pill entities in the room.
 *
 * @param pillColor Optional. If specified, will only get the pills that match the sub-type. Default
 *                  is -1, which matches every sub-type.
 */
function getPills(pillColor = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.PILL, pillColor);
}
exports.getPills = getPills;
/**
 * Helper function to get all of the sack (i.e. grab bag) entities in the room.
 *
 * @param sackSubType Optional. If specified, will only get the sacks that match the sub-type.
 *                    Default is -1, which matches every sub-type.
 */
function getSacks(sackSubType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.SACK, sackSubType);
}
exports.getSacks = getSacks;
/**
 * Helper function to get all of the trinket entities in the room.
 *
 * @param trinketType Optional. If specified, will only get the trinkets that match the sub-type.
 *                    Default is -1, which matches every sub-type.
 */
function getTrinkets(trinketType = -1) {
    return (0, entitiesSpecific_1.getPickups)(isaac_typescript_definitions_1.PickupVariant.TRINKET, trinketType);
}
exports.getTrinkets = getTrinkets;
/**
 * Helper function to remove all of the batteries in the room.
 *
 * @param batterySubType Optional. If specified, will only remove the batteries that match this
 *                       sub-type. Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of cards.
 * @returns The batteries that were removed.
 */
function removeAllBatteries(batterySubType = -1, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.LIL_BATTERY, batterySubType, cap);
}
exports.removeAllBatteries = removeAllBatteries;
/**
 * Helper function to remove all of the bomb pickups in the room. (Specifically, this refers to bomb
 * pickups, not the `EntityBomb` class.)
 *
 * @param bombSubType Optional. If specified, will only remove bombs that match this sub-type.
 *                    Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of bombs.
 * @returns The bombs that were removed.
 */
function removeAllBombPickups(bombSubType = -1, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.BOMB, bombSubType, cap);
}
exports.removeAllBombPickups = removeAllBombPickups;
/**
 * Helper function to remove all of the cards in the room.
 *
 * @param cardType Optional. If specified, will only remove cards that match this sub-type. Default
 *                 is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of cards.
 * @returns The cards that were removed.
 */
function removeAllCards(cardType = -1, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.CARD, cardType, cap);
}
exports.removeAllCards = removeAllCards;
/**
 * Helper function to remove all of the chests in the room. Specifically, this is all of the pickups
 * with a variant in the `CHEST_PICKUP_VARIANTS` constant.
 *
 * @param subType Optional. If specified, will only remove chests that match this sub-type. Default
 *                is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of chests.
 * @returns The chests that were removed.
 */
function removeAllChests(subType = -1, cap) {
    const chests = getChests(subType);
    return (0, entities_1.removeEntities)(chests, cap);
}
exports.removeAllChests = removeAllChests;
/**
 * Helper function to remove all of the coins in the room.
 *
 * @param coinSubType Optional. If specified, will only remove coins that match this sub-type.
 *                    Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of coins.
 * @returns The coins that were removed.
 */
function removeAllCoins(coinSubType, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.COIN, coinSubType, cap);
}
exports.removeAllCoins = removeAllCoins;
/**
 * Helper function to remove all of the collectibles in the room.
 *
 * @param collectibleType Optional. If specified, will only remove collectibles that match this
 *                        sub-type. Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of collectibles.
 * @returns The collectibles that were removed.
 */
function removeAllCollectibles(collectibleType, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.COLLECTIBLE, collectibleType, cap);
}
exports.removeAllCollectibles = removeAllCollectibles;
/**
 * Helper function to remove all of the heart pickup entities in the room.
 *
 * @param heartSubType Optional. If specified, will only remove hearts that match this sub-type.
 *                     Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of hearts.
 * @returns The hearts that were removed.
 */
function removeAllHearts(heartSubType, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.HEART, heartSubType, cap);
}
exports.removeAllHearts = removeAllHearts;
/**
 * Helper function to remove all of the keys in the room.
 *
 * @param keySubType Optional. If specified, will only remove keys that match this sub-type. Default
 *                   is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of keys.
 * @returns The keys that were removed.
 */
function removeAllKeys(keySubType, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.KEY, keySubType, cap);
}
exports.removeAllKeys = removeAllKeys;
/**
 * Helper function to remove all of the pills in the room.
 *
 * @param pillColor Optional. If specified, will only remove pills that match this sub-type. Default
 *                  is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of pills.
 * @returns The pills that were removed.
 */
function removeAllPills(pillColor, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.PILL, pillColor, cap);
}
exports.removeAllPills = removeAllPills;
/**
 * Helper function to remove all of the sacks (i.e. grab bags) in the room.
 *
 * @param sackSubType Optional. If specified, will only remove sacks that match this sub-type.
 *                    Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of sacks.
 * @returns The sacks that were removed.
 */
function removeAllSacks(sackSubType, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.SACK, sackSubType, cap);
}
exports.removeAllSacks = removeAllSacks;
/**
 * Helper function to remove all of the trinkets in the room.
 *
 * @param trinketType Optional. If specified, will only remove trinkets that match this sub-type.
 *                    Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of trinkets.
 * @returns The trinkets that were removed.
 */
function removeAllTrinkets(trinketType, cap) {
    return (0, entitiesSpecific_1.removeAllPickups)(isaac_typescript_definitions_1.PickupVariant.TRINKET, trinketType, cap);
}
exports.removeAllTrinkets = removeAllTrinkets;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90).
 */
function spawnBattery(batterySubType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.LIL_BATTERY, batterySubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnBattery = spawnBattery;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90)
 * and a specific seed.
 */
function spawnBatteryWithSeed(batterySubType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnBattery(batterySubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnBatteryWithSeed = spawnBatteryWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40). */
function spawnBombPickup(bombSubType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.BOMB, bombSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnBombPickup = spawnBombPickup;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40) and a
 * specific seed.
 */
function spawnBombPickupWithSeed(bombSubType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnBombPickup(bombSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnBombPickupWithSeed = spawnBombPickupWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.CARD` (300). */
function spawnCard(cardType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.CARD, cardType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnCard = spawnCard;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.CARD` (300) and a
 * specific seed.
 */
function spawnCardWithSeed(cardType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnCard(cardType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnCardWithSeed = spawnCardWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */
function spawnCoin(coinSubType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.COIN, coinSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnCoin = spawnCoin;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20) and a
 * specific seed.
 */
function spawnCoinWithSeed(coinSubType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnCoin(coinSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnCoinWithSeed = spawnCoinWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10). */
function spawnHeart(heartSubType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.HEART, heartSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnHeart = spawnHeart;
function spawnHeartWithSeed(heartSubType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnHeart(heartSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnHeartWithSeed = spawnHeartWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30). */
function spawnKey(keySubType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.KEY, keySubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnKey = spawnKey;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30) and a
 * specific seed.
 */
function spawnKeyWithSeed(keySubType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnKey(keySubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnKeyWithSeed = spawnKeyWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70). */
function spawnPill(pillColor, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.PILL, pillColor, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnPill = spawnPill;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70) and a
 * specific seed.
 */
function spawnPillWithSeed(pillColor, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnPill(pillColor, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnPillWithSeed = spawnPillWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69). */
function spawnSack(sackSubType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.SACK, sackSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnSack = spawnSack;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69) and a
 * specific seed.
 */
function spawnSackWithSeed(sackSubType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnSack(sackSubType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnSackWithSeed = spawnSackWithSeed;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350).
 */
function spawnTrinket(trinketType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entitiesSpecific_1.spawnPickup)(isaac_typescript_definitions_1.PickupVariant.TRINKET, trinketType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnTrinket = spawnTrinket;
/**
 * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350) and
 * a specific seed.
 */
function spawnTrinketWithSeed(trinketType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnTrinket(trinketType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnTrinketWithSeed = spawnTrinketWithSeed;
