UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

25 lines (24 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PreEntitySpawnFilter = void 0; const isaac_typescript_definitions_1 = require("isaac-typescript-definitions"); const CustomCallback_1 = require("../private/CustomCallback"); class PreEntitySpawnFilter extends CustomCallback_1.CustomCallback { constructor() { super(); this.callbacksUsed = [ // 24 [isaac_typescript_definitions_1.ModCallback.PRE_ENTITY_SPAWN, this.preEntitySpawn], ]; } shouldFire = (fireArgs, optionalArgs) => { const [entityType, variant, subType] = fireArgs; const [callbackEntityType, callbackVariant, callbackSubType] = optionalArgs; return ((callbackEntityType === undefined || callbackEntityType === entityType) && (callbackVariant === undefined || callbackVariant === variant) && (callbackSubType === undefined || callbackSubType === subType)); }; // ModCallback.PRE_ENTITY_SPAWN (24) preEntitySpawn = (entityType, variant, subType, position, velocity, spawner, initSeed) => this.fire(entityType, variant, subType, position, velocity, spawner, initSeed); } exports.PreEntitySpawnFilter = PreEntitySpawnFilter;