"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnTearWithSeed = exports.spawnTear = exports.spawnSlotWithSeed = exports.spawnSlot = exports.spawnProjectileWithSeed = exports.spawnProjectile = exports.spawnPickupWithSeed = exports.spawnPickup = exports.spawnNPCWithSeed = exports.spawnNPC = exports.spawnLaserWithSeed = exports.spawnLaser = exports.spawnKnifeWithSeed = exports.spawnKnife = exports.spawnFamiliarWithSeed = exports.spawnFamiliar = exports.spawnEffectWithSeed = exports.spawnEffect = exports.spawnBombWithSeed = exports.spawnBomb = exports.removeAllTears = exports.removeAllSlots = exports.removeAllProjectiles = exports.removeAllPickups = exports.removeAllNPCs = exports.removeAllLasers = exports.removeAllKnives = exports.removeAllFamiliars = exports.removeAllEffects = exports.removeAllBombs = exports.getTears = exports.getSlots = exports.getProjectiles = exports.getPickups = exports.getNPCs = exports.getLasers = exports.getKnives = exports.getFamiliars = exports.getEffects = exports.getBombs = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const constants_1 = require("../core/constants");
const entities_1 = require("./entities");
const utils_1 = require("./utils");
/**
 * Helper function to get all of the bombs in the room. (Specifically, this refers to the
 * `EntityBomb` class, not bomb pickups.)
 *
 * For example:
 *
 * ```ts
 * // Make all of the bombs in the room invisible.
 * for (const bomb of getBombs()) {
 *   bomb.Visible = false;
 * }
 * ```
 *
 * @param bombVariant Optional. If specified, will only get the bombs that match the variant.
 *                    Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only get the bombs that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getBombs(bombVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.BOMB, bombVariant, subType);
    const bombs = [];
    for (const entity of entities) {
        const bomb = entity.ToBomb();
        if (bomb !== undefined) {
            bombs.push(bomb);
        }
    }
    return bombs;
}
exports.getBombs = getBombs;
/**
 * Helper function to get all of the effects in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the effects in the room invisible.
 * for (const effect of getEffects()) {
 *   effect.Visible = false;
 * }
 * ```
 *
 * @param effectVariant Optional. If specified, will only get the effects that match the variant.
 *                      Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only get the effects that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getEffects(effectVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.EFFECT, effectVariant, subType);
    const effects = [];
    for (const entity of entities) {
        const effect = entity.ToEffect();
        if (effect !== undefined) {
            effects.push(effect);
        }
    }
    return effects;
}
exports.getEffects = getEffects;
/**
 * Helper function to get all of the familiars in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the familiars in the room invisible.
 * for (const familiar of getFamiliars()) {
 *   familiar.Visible = false;
 * }
 * ```
 *
 * @param familiarVariant Optional. If specified, will only get the familiars that match the
 *                        variant. Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only get the familiars that match the sub-type.
 *                Default is -1, which matches every sub-type.
 */
function getFamiliars(familiarVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.FAMILIAR, familiarVariant, subType);
    const familiars = [];
    for (const entity of entities) {
        const familiar = entity.ToFamiliar();
        if (familiar !== undefined) {
            familiars.push(familiar);
        }
    }
    return familiars;
}
exports.getFamiliars = getFamiliars;
/**
 * Helper function to get all of the knives in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the knives in the room invisible.
 * for (const knife of getKnives()) {
 *   knife.Visible = false;
 * }
 * ```
 *
 * @param knifeVariant Optional. If specified, will only get the knives that match the variant.
 *                     Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only get the knives that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getKnives(knifeVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.KNIFE, knifeVariant, subType);
    const knives = [];
    for (const entity of entities) {
        const knife = entity.ToKnife();
        if (knife !== undefined) {
            knives.push(knife);
        }
    }
    return knives;
}
exports.getKnives = getKnives;
/**
 * Helper function to get all of the lasers in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the lasers in the room invisible.
 * for (const laser of getLasers()) {
 *   laser.Visible = false;
 * }
 * ```
 *
 * @param laserVariant Optional. If specified, will only get the lasers that match the variant.
 *                     Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only get the lasers that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getLasers(laserVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.LASER, laserVariant, subType);
    const lasers = [];
    for (const entity of entities) {
        const laser = entity.ToLaser();
        if (laser !== undefined) {
            lasers.push(laser);
        }
    }
    return lasers;
}
exports.getLasers = getLasers;
/**
 * Helper function to get all of the NPCs in the room.
 *
 * @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
 *                   -1, which matches every entity type.
 * @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
 *                -1, which matches every entity type.
 * @param subType Optional. If specified, will only get the bombs that match the sub-type. Default
 *                is -1, which matches every sub-type.
 * @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
 *                       returned. Default is false. Will only be taken into account if the
 *                       `entityType` is specified.
 */
function getNPCs(entityType = -1, variant = -1, subType = -1, ignoreFriendly = false) {
    const entities = (0, entities_1.getEntities)(entityType, variant, subType, ignoreFriendly);
    const npcs = [];
    for (const entity of entities) {
        const npc = entity.ToNPC();
        if (npc !== undefined) {
            npcs.push(npc);
        }
    }
    return npcs;
}
exports.getNPCs = getNPCs;
/**
 * Helper function to get all of the pickups in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the pickups in the room invisible.
 * for (const pickup of getPickups()) {
 *   pickup.Visible = false;
 * }
 * ```
 *
 * @param pickupVariant Optional. If specified, will only get the pickups that match the variant.
 *                      Default is -1, which matches every entity type.
 * @param subType Optional. If specified, will only get the pickups that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getPickups(pickupVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.PICKUP, pickupVariant, subType);
    const pickups = [];
    for (const entity of entities) {
        const pickup = entity.ToPickup();
        if (pickup !== undefined) {
            pickups.push(pickup);
        }
    }
    return pickups;
}
exports.getPickups = getPickups;
/**
 * Helper function to get all of the projectiles in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the projectiles in the room invisible.
 * for (const projectile of getProjectiles()) {
 *   projectile.Visible = false;
 * }
 * ```
 *
 * @param projectileVariant Optional. If specified, will only get the projectiles that match the
 *                          variant. Default is -1, which matches every entity type.
 * @param subType Optional. If specified, will only get the projectiles that match the sub-type.
 *                Default is -1, which matches every sub-type.
 */
function getProjectiles(projectileVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.PROJECTILE, projectileVariant, subType);
    const projectiles = [];
    for (const entity of entities) {
        const projectile = entity.ToProjectile();
        if (projectile !== undefined) {
            projectiles.push(projectile);
        }
    }
    return projectiles;
}
exports.getProjectiles = getProjectiles;
/**
 * Helper function to get all of the slots in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the slots in the room invisible.
 * for (const slot of getSlots()) {
 *   slot.Visible = false;
 * }
 * ```
 *
 * @param slotVariant Optional. If specified, will only get the slots that match the variant.
 *                    Default is -1, which matches every entity type.
 * @param subType Optional. If specified, will only get the slots that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getSlots(slotVariant = -1, subType = -1) {
    const slots = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.SLOT, slotVariant, subType);
    return slots;
}
exports.getSlots = getSlots;
/**
 * Helper function to get all of the tears in the room.
 *
 * For example:
 *
 * ```ts
 * // Make all of the tears in the room invisible.
 * for (const tear of getTears()) {
 *   tear.Visible = false;
 * }
 * ```
 *
 * @param tearVariant Optional. If specified, will only get the tears that match the variant.
 *                    Default is -1, which matches every entity type.
 * @param subType Optional. If specified, will only get the tears that match the sub-type. Default
 *                is -1, which matches every sub-type.
 */
function getTears(tearVariant = -1, subType = -1) {
    const entities = (0, entities_1.getEntities)(isaac_typescript_definitions_1.EntityType.TEAR, tearVariant, subType);
    const tears = [];
    for (const entity of entities) {
        const tear = entity.ToTear();
        if (tear !== undefined) {
            tears.push(tear);
        }
    }
    return tears;
}
exports.getTears = getTears;
/**
 * Helper function to remove all of the bombs in the room. (Specifically, this refers to the
 * `EntityBomb` class, not bomb pickups.)
 *
 * @param bombVariant Optional. If specified, will only remove the bombs that match the variant.
 *                    Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove the bombs that match the sub-type.
 *                Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of bombs.
 * @returns An array of the bombs that were removed.
 */
function removeAllBombs(bombVariant = -1, subType = -1, cap) {
    const bombs = getBombs(bombVariant, subType);
    return (0, entities_1.removeEntities)(bombs, cap);
}
exports.removeAllBombs = removeAllBombs;
/**
 * Helper function to remove all of the effects in the room.
 *
 * @param effectVariant Optional. If specified, will only remove the effects that match the variant.
 *                      Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove the effects that match the sub-type.
 *                Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of effects.
 * @returns An array of the effects that were removed.
 */
function removeAllEffects(effectVariant = -1, subType = -1, cap) {
    const effects = getEffects(effectVariant, subType);
    return (0, entities_1.removeEntities)(effects, cap);
}
exports.removeAllEffects = removeAllEffects;
/**
 * Helper function to remove all of the familiars in the room.
 *
 * @param familiarVariant Optional. If specified, will only remove the familiars that match the
 *                        variant. Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove the familiars that match the sub-type.
 *                Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of familiars.
 * @returns An array of the familiars that were removed.
 */
function removeAllFamiliars(familiarVariant = -1, subType = -1, cap) {
    const familiars = getFamiliars(familiarVariant, subType);
    return (0, entities_1.removeEntities)(familiars, cap);
}
exports.removeAllFamiliars = removeAllFamiliars;
/**
 * Helper function to remove all of the knives in the room.
 *
 * @param knifeVariant Optional. If specified, will only remove the knives that match the variant.
 *                     Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove the knives that match the sub-type.
 *                Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of knives.
 * @returns An array of the knives that were removed.
 */
function removeAllKnives(knifeVariant = -1, subType = -1, cap) {
    const knives = getKnives(knifeVariant, subType);
    return (0, entities_1.removeEntities)(knives, cap);
}
exports.removeAllKnives = removeAllKnives;
/**
 * Helper function to remove all of the lasers in the room.
 *
 * @param laserVariant Optional. If specified, will only remove the lasers that match the variant.
 *                     Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove the lasers that match the sub-type.
 *                Default is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of lasers.
 * @returns An array of the lasers that were removed.
 */
function removeAllLasers(laserVariant = -1, subType = -1, cap) {
    const lasers = getLasers(laserVariant, subType);
    return (0, entities_1.removeEntities)(lasers, cap);
}
exports.removeAllLasers = removeAllLasers;
/**
 * Helper function to remove all of the NPCs in the room.
 *
 * @param entityType Optional. If specified, will only remove the NPCs that match the type. Default
 *                   is -1, which matches every type.
 * @param variant Optional. If specified, will only remove the NPCs that match the variant. Default
 *                is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove the NPCs that match the sub-type. Default
 *                is -1, which matches every sub-type.
 * @param cap Optional. If specified, will only remove the given amount of NPCs.
 * @returns An array of the NPCs that were removed.
 */
function removeAllNPCs(entityType = -1, variant = -1, subType = -1, cap) {
    const npcs = getNPCs(entityType, variant, subType);
    return (0, entities_1.removeEntities)(npcs, cap);
}
exports.removeAllNPCs = removeAllNPCs;
/**
 * Helper function to remove all of the pickups in the room.
 *
 * @param pickupVariant Optional. If specified, will only remove pickups that match this variant.
 *                      Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove pickups 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 pickups.
 * @returns An array of the pickups that were removed.
 */
function removeAllPickups(pickupVariant = -1, subType = -1, cap) {
    const pickups = getPickups(pickupVariant, subType);
    return (0, entities_1.removeEntities)(pickups, cap);
}
exports.removeAllPickups = removeAllPickups;
/**
 * Helper function to remove all of the projectiles in the room.
 *
 * @param projectileVariant Optional. If specified, will only remove projectiles that match this
 *                          variant. Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove projectiles 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 projectiles.
 * @returns An array of the projectiles that were removed.
 */
function removeAllProjectiles(projectileVariant = -1, subType = -1, cap) {
    const projectiles = getProjectiles(projectileVariant, subType);
    return (0, entities_1.removeEntities)(projectiles, cap);
}
exports.removeAllProjectiles = removeAllProjectiles;
/**
 * Helper function to remove all of the slots in the room.
 *
 * @param slotVariant Optional. If specified, will only remove slots that match this variant.
 *                    Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove slots 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 slots.
 * @returns An array of the slots that were removed.
 */
function removeAllSlots(slotVariant = -1, subType = -1, cap) {
    const slots = getSlots(slotVariant, subType);
    return (0, entities_1.removeEntities)(slots, cap);
}
exports.removeAllSlots = removeAllSlots;
/**
 * Helper function to remove all of the tears in the room.
 *
 * @param tearVariant Optional. If specified, will only remove tears that match this variant.
 *                    Default is -1, which matches every variant.
 * @param subType Optional. If specified, will only remove tears 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 tears.
 * @returns An array of the tears that were removed.
 */
function removeAllTears(tearVariant = -1, subType = -1, cap) {
    const tears = getTears(tearVariant, subType);
    return (0, entities_1.removeEntities)(tears, cap);
}
exports.removeAllTears = removeAllTears;
/** Helper function to spawn a `EntityType.BOMB` (4). */
function spawnBomb(bombVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.BOMB, bombVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const bomb = entity.ToBomb();
    (0, utils_1.assertDefined)(bomb, "Failed to spawn a bomb.");
    return bomb;
}
exports.spawnBomb = spawnBomb;
/** Helper function to spawn a `EntityType.BOMB` (4) with a specific seed. */
function spawnBombWithSeed(bombVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnBomb(bombVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnBombWithSeed = spawnBombWithSeed;
/** Helper function to spawn a `EntityType.EFFECT` (1000). */
function spawnEffect(effectVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.EFFECT, effectVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const effect = entity.ToEffect();
    (0, utils_1.assertDefined)(effect, "Failed to spawn an effect.");
    return effect;
}
exports.spawnEffect = spawnEffect;
/** Helper function to spawn a `EntityType.EFFECT` (1000) with a specific seed. */
function spawnEffectWithSeed(effectVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnEffect(effectVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnEffectWithSeed = spawnEffectWithSeed;
/**
 * Helper function to spawn a `EntityType.FAMILIAR` (3).
 *
 * If you are trying to implement a custom familiar, you probably want to use the
 * `checkFamiliarFromCollectibles` helper function instead.
 */
function spawnFamiliar(familiarVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.FAMILIAR, familiarVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const familiar = entity.ToFamiliar();
    (0, utils_1.assertDefined)(familiar, "Failed to spawn a familiar.");
    return familiar;
}
exports.spawnFamiliar = spawnFamiliar;
/** Helper function to spawn a `EntityType.FAMILIAR` (3) with a specific seed. */
function spawnFamiliarWithSeed(familiarVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnFamiliar(familiarVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnFamiliarWithSeed = spawnFamiliarWithSeed;
/** Helper function to spawn a `EntityType.KNIFE` (8). */
function spawnKnife(knifeVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.KNIFE, knifeVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const knife = entity.ToKnife();
    (0, utils_1.assertDefined)(knife, "Failed to spawn a knife.");
    return knife;
}
exports.spawnKnife = spawnKnife;
/** Helper function to spawn a `EntityType.KNIFE` (8) with a specific seed. */
function spawnKnifeWithSeed(knifeVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnKnife(knifeVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnKnifeWithSeed = spawnKnifeWithSeed;
/** Helper function to spawn a `EntityType.LASER` (7). */
function spawnLaser(laserVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.LASER, laserVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const laser = entity.ToLaser();
    (0, utils_1.assertDefined)(laser, "Failed to spawn a laser.");
    return laser;
}
exports.spawnLaser = spawnLaser;
/** Helper function to spawn a `EntityType.LASER` (7) with a specific seed. */
function spawnLaserWithSeed(laserVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnLaser(laserVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnLaserWithSeed = spawnLaserWithSeed;
/**
 * Helper function to spawn an NPC.
 *
 * Note that if you pass a non-NPC `EntityType` to this function, it will cause a run-time error,
 * since the `Entity.ToNPC` method will return undefined.
 */
function spawnNPC(entityType, variant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(entityType, variant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const npc = entity.ToNPC();
    (0, utils_1.assertDefined)(npc, "Failed to spawn an NPC.");
    return npc;
}
exports.spawnNPC = spawnNPC;
/**
 * Helper function to spawn an NPC with a specific seed.
 *
 * Note that if you pass a non-NPC `EntityType` to this function, it will cause a run-time error,
 * since the `Entity.ToNPC` method will return undefined.
 */
function spawnNPCWithSeed(entityType, variant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnNPC(entityType, variant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnNPCWithSeed = spawnNPCWithSeed;
/** Helper function to spawn a `EntityType.PICKUP` (5). */
function spawnPickup(pickupVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.PICKUP, pickupVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const pickup = entity.ToPickup();
    (0, utils_1.assertDefined)(pickup, "Failed to spawn a pickup.");
    return pickup;
}
exports.spawnPickup = spawnPickup;
/** Helper function to spawn a `EntityType.PICKUP` (5) with a specific seed. */
function spawnPickupWithSeed(pickupVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnPickup(pickupVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnPickupWithSeed = spawnPickupWithSeed;
/** Helper function to spawn a `EntityType.PROJECTILE` (9). */
function spawnProjectile(projectileVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.PROJECTILE, projectileVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const projectile = entity.ToProjectile();
    (0, utils_1.assertDefined)(projectile, "Failed to spawn a projectile.");
    return projectile;
}
exports.spawnProjectile = spawnProjectile;
/** Helper function to spawn a `EntityType.PROJECTILE` (9) with a specific seed. */
function spawnProjectileWithSeed(projectileVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnProjectile(projectileVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnProjectileWithSeed = spawnProjectileWithSeed;
/** Helper function to spawn a `EntityType.SLOT` (6). */
function spawnSlot(slotVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    return (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.SLOT, slotVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnSlot = spawnSlot;
/** Helper function to spawn a `EntityType.SLOT` (6) with a specific seed. */
function spawnSlotWithSeed(slotVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnSlot(slotVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnSlotWithSeed = spawnSlotWithSeed;
/** Helper function to spawn a `EntityType.TEAR` (2). */
function spawnTear(tearVariant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined) {
    const entity = (0, entities_1.spawn)(isaac_typescript_definitions_1.EntityType.TEAR, tearVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
    const tear = entity.ToTear();
    (0, utils_1.assertDefined)(tear, "Failed to spawn a tear.");
    return tear;
}
exports.spawnTear = spawnTear;
/** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */
function spawnTearWithSeed(tearVariant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined) {
    return spawnTear(tearVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG);
}
exports.spawnTearWithSeed = spawnTearWithSeed;
