"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostGridEntityCollision = void 0;
const ISCFeature_1 = require("../../enums/ISCFeature");
const CustomCallback_1 = require("../private/CustomCallback");
class PostGridEntityCollision extends CustomCallback_1.CustomCallback {
    constructor() {
        super();
        this.featuresUsed = [ISCFeature_1.ISCFeature.GRID_ENTITY_COLLISION_DETECTION];
    }
    shouldFire = (fireArgs, optionalArgs) => {
        const [gridEntity, entity] = fireArgs;
        const [callbackGridEntityType, callbackGridEntityVariant, callbackEntityType, callbackEntityVariant, callbackEntitySubType,] = optionalArgs;
        const gridEntityType = gridEntity.GetType();
        const gridEntityVariant = gridEntity.GetVariant();
        return ((callbackGridEntityType === undefined ||
            callbackGridEntityType === gridEntityType) &&
            (callbackGridEntityVariant === undefined ||
                callbackGridEntityVariant === gridEntityVariant) &&
            (callbackEntityType === undefined ||
                callbackEntityType === entity.Type) &&
            (callbackEntityVariant === undefined ||
                callbackEntityVariant === entity.Variant) &&
            (callbackEntitySubType === undefined ||
                callbackEntitySubType === entity.SubType));
    };
}
exports.PostGridEntityCollision = PostGridEntityCollision;
