local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
local ____constants = require("core.constants")
local VectorZero = ____constants.VectorZero
local ____entities = require("functions.entities")
local getEntities = ____entities.getEntities
local removeEntities = ____entities.removeEntities
local spawn = ____entities.spawn
local ____utils = require("functions.utils")
local assertDefined = ____utils.assertDefined
--- 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 ____exports.getBombs(self, bombVariant, subType)
    if bombVariant == nil then
        bombVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.BOMB, bombVariant, subType)
    local bombs = {}
    for ____, entity in ipairs(entities) do
        local bomb = entity:ToBomb()
        if bomb ~= nil then
            bombs[#bombs + 1] = bomb
        end
    end
    return bombs
end
--- 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 ____exports.getEffects(self, effectVariant, subType)
    if effectVariant == nil then
        effectVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.EFFECT, effectVariant, subType)
    local effects = {}
    for ____, entity in ipairs(entities) do
        local effect = entity:ToEffect()
        if effect ~= nil then
            effects[#effects + 1] = effect
        end
    end
    return effects
end
--- 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 ____exports.getFamiliars(self, familiarVariant, subType)
    if familiarVariant == nil then
        familiarVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.FAMILIAR, familiarVariant, subType)
    local familiars = {}
    for ____, entity in ipairs(entities) do
        local familiar = entity:ToFamiliar()
        if familiar ~= nil then
            familiars[#familiars + 1] = familiar
        end
    end
    return familiars
end
--- 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 ____exports.getKnives(self, knifeVariant, subType)
    if knifeVariant == nil then
        knifeVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.KNIFE, knifeVariant, subType)
    local knives = {}
    for ____, entity in ipairs(entities) do
        local knife = entity:ToKnife()
        if knife ~= nil then
            knives[#knives + 1] = knife
        end
    end
    return knives
end
--- 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 ____exports.getLasers(self, laserVariant, subType)
    if laserVariant == nil then
        laserVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.LASER, laserVariant, subType)
    local lasers = {}
    for ____, entity in ipairs(entities) do
        local laser = entity:ToLaser()
        if laser ~= nil then
            lasers[#lasers + 1] = laser
        end
    end
    return lasers
end
--- 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 ____exports.getNPCs(self, entityType, variant, subType, ignoreFriendly)
    if entityType == nil then
        entityType = -1
    end
    if variant == nil then
        variant = -1
    end
    if subType == nil then
        subType = -1
    end
    if ignoreFriendly == nil then
        ignoreFriendly = false
    end
    local entities = getEntities(
        nil,
        entityType,
        variant,
        subType,
        ignoreFriendly
    )
    local npcs = {}
    for ____, entity in ipairs(entities) do
        local npc = entity:ToNPC()
        if npc ~= nil then
            npcs[#npcs + 1] = npc
        end
    end
    return npcs
end
--- 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 ____exports.getPickups(self, pickupVariant, subType)
    if pickupVariant == nil then
        pickupVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.PICKUP, pickupVariant, subType)
    local pickups = {}
    for ____, entity in ipairs(entities) do
        local pickup = entity:ToPickup()
        if pickup ~= nil then
            pickups[#pickups + 1] = pickup
        end
    end
    return pickups
end
--- 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 ____exports.getProjectiles(self, projectileVariant, subType)
    if projectileVariant == nil then
        projectileVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.PROJECTILE, projectileVariant, subType)
    local projectiles = {}
    for ____, entity in ipairs(entities) do
        local projectile = entity:ToProjectile()
        if projectile ~= nil then
            projectiles[#projectiles + 1] = projectile
        end
    end
    return projectiles
end
--- 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 ____exports.getSlots(self, slotVariant, subType)
    if slotVariant == nil then
        slotVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local slots = getEntities(nil, EntityType.SLOT, slotVariant, subType)
    return slots
end
--- 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 ____exports.getTears(self, tearVariant, subType)
    if tearVariant == nil then
        tearVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local entities = getEntities(nil, EntityType.TEAR, tearVariant, subType)
    local tears = {}
    for ____, entity in ipairs(entities) do
        local tear = entity:ToTear()
        if tear ~= nil then
            tears[#tears + 1] = tear
        end
    end
    return tears
end
--- 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 ____exports.removeAllBombs(self, bombVariant, subType, cap)
    if bombVariant == nil then
        bombVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local bombs = ____exports.getBombs(nil, bombVariant, subType)
    return removeEntities(nil, bombs, cap)
end
--- 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 ____exports.removeAllEffects(self, effectVariant, subType, cap)
    if effectVariant == nil then
        effectVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local effects = ____exports.getEffects(nil, effectVariant, subType)
    return removeEntities(nil, effects, cap)
end
--- 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 ____exports.removeAllFamiliars(self, familiarVariant, subType, cap)
    if familiarVariant == nil then
        familiarVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local familiars = ____exports.getFamiliars(nil, familiarVariant, subType)
    return removeEntities(nil, familiars, cap)
end
--- 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 ____exports.removeAllKnives(self, knifeVariant, subType, cap)
    if knifeVariant == nil then
        knifeVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local knives = ____exports.getKnives(nil, knifeVariant, subType)
    return removeEntities(nil, knives, cap)
end
--- 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 ____exports.removeAllLasers(self, laserVariant, subType, cap)
    if laserVariant == nil then
        laserVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local lasers = ____exports.getLasers(nil, laserVariant, subType)
    return removeEntities(nil, lasers, cap)
end
--- 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 ____exports.removeAllNPCs(self, entityType, variant, subType, cap)
    if entityType == nil then
        entityType = -1
    end
    if variant == nil then
        variant = -1
    end
    if subType == nil then
        subType = -1
    end
    local npcs = ____exports.getNPCs(nil, entityType, variant, subType)
    return removeEntities(nil, npcs, cap)
end
--- 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 ____exports.removeAllPickups(self, pickupVariant, subType, cap)
    if pickupVariant == nil then
        pickupVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local pickups = ____exports.getPickups(nil, pickupVariant, subType)
    return removeEntities(nil, pickups, cap)
end
--- 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 ____exports.removeAllProjectiles(self, projectileVariant, subType, cap)
    if projectileVariant == nil then
        projectileVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local projectiles = ____exports.getProjectiles(nil, projectileVariant, subType)
    return removeEntities(nil, projectiles, cap)
end
--- 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 ____exports.removeAllSlots(self, slotVariant, subType, cap)
    if slotVariant == nil then
        slotVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local slots = ____exports.getSlots(nil, slotVariant, subType)
    return removeEntities(nil, slots, cap)
end
--- 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 ____exports.removeAllTears(self, tearVariant, subType, cap)
    if tearVariant == nil then
        tearVariant = -1
    end
    if subType == nil then
        subType = -1
    end
    local tears = ____exports.getTears(nil, tearVariant, subType)
    return removeEntities(nil, tears, cap)
end
--- Helper function to spawn a `EntityType.BOMB` (4).
function ____exports.spawnBomb(self, bombVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.BOMB,
        bombVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local bomb = entity:ToBomb()
    assertDefined(nil, bomb, "Failed to spawn a bomb.")
    return bomb
end
--- Helper function to spawn a `EntityType.BOMB` (4) with a specific seed.
function ____exports.spawnBombWithSeed(self, bombVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnBomb(
        nil,
        bombVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.EFFECT` (1000).
function ____exports.spawnEffect(self, effectVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.EFFECT,
        effectVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local effect = entity:ToEffect()
    assertDefined(nil, effect, "Failed to spawn an effect.")
    return effect
end
--- Helper function to spawn a `EntityType.EFFECT` (1000) with a specific seed.
function ____exports.spawnEffectWithSeed(self, effectVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnEffect(
        nil,
        effectVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- 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 ____exports.spawnFamiliar(self, familiarVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.FAMILIAR,
        familiarVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local familiar = entity:ToFamiliar()
    assertDefined(nil, familiar, "Failed to spawn a familiar.")
    return familiar
end
--- Helper function to spawn a `EntityType.FAMILIAR` (3) with a specific seed.
function ____exports.spawnFamiliarWithSeed(self, familiarVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnFamiliar(
        nil,
        familiarVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.KNIFE` (8).
function ____exports.spawnKnife(self, knifeVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.KNIFE,
        knifeVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local knife = entity:ToKnife()
    assertDefined(nil, knife, "Failed to spawn a knife.")
    return knife
end
--- Helper function to spawn a `EntityType.KNIFE` (8) with a specific seed.
function ____exports.spawnKnifeWithSeed(self, knifeVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnKnife(
        nil,
        knifeVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.LASER` (7).
function ____exports.spawnLaser(self, laserVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.LASER,
        laserVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local laser = entity:ToLaser()
    assertDefined(nil, laser, "Failed to spawn a laser.")
    return laser
end
--- Helper function to spawn a `EntityType.LASER` (7) with a specific seed.
function ____exports.spawnLaserWithSeed(self, laserVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnLaser(
        nil,
        laserVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- 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 ____exports.spawnNPC(self, entityType, variant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        entityType,
        variant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local npc = entity:ToNPC()
    assertDefined(nil, npc, "Failed to spawn an NPC.")
    return npc
end
--- 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 ____exports.spawnNPCWithSeed(self, entityType, variant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnNPC(
        nil,
        entityType,
        variant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.PICKUP` (5).
function ____exports.spawnPickup(self, pickupVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.PICKUP,
        pickupVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local pickup = entity:ToPickup()
    assertDefined(nil, pickup, "Failed to spawn a pickup.")
    return pickup
end
--- Helper function to spawn a `EntityType.PICKUP` (5) with a specific seed.
function ____exports.spawnPickupWithSeed(self, pickupVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnPickup(
        nil,
        pickupVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.PROJECTILE` (9).
function ____exports.spawnProjectile(self, projectileVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.PROJECTILE,
        projectileVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local projectile = entity:ToProjectile()
    assertDefined(nil, projectile, "Failed to spawn a projectile.")
    return projectile
end
--- Helper function to spawn a `EntityType.PROJECTILE` (9) with a specific seed.
function ____exports.spawnProjectileWithSeed(self, projectileVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnProjectile(
        nil,
        projectileVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.SLOT` (6).
function ____exports.spawnSlot(self, slotVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    return spawn(
        nil,
        EntityType.SLOT,
        slotVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.SLOT` (6) with a specific seed.
function ____exports.spawnSlotWithSeed(self, slotVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnSlot(
        nil,
        slotVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
--- Helper function to spawn a `EntityType.TEAR` (2).
function ____exports.spawnTear(self, tearVariant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG)
    if velocity == nil then
        velocity = VectorZero
    end
    local entity = spawn(
        nil,
        EntityType.TEAR,
        tearVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
    local tear = entity:ToTear()
    assertDefined(nil, tear, "Failed to spawn a tear.")
    return tear
end
--- Helper function to spawn a `EntityType.EntityType` (2) with a specific seed.
function ____exports.spawnTearWithSeed(self, tearVariant, subType, positionOrGridIndex, seedOrRNG, velocity, spawner)
    if velocity == nil then
        velocity = VectorZero
    end
    return ____exports.spawnTear(
        nil,
        tearVariant,
        subType,
        positionOrGridIndex,
        velocity,
        spawner,
        seedOrRNG
    )
end
return ____exports
