"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InputActionPlayer = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const CustomCallback_1 = require("../private/CustomCallback");
class InputActionPlayer extends CustomCallback_1.CustomCallback {
    constructor() {
        super();
        this.callbacksUsed = [
            // 13
            [isaac_typescript_definitions_1.ModCallback.INPUT_ACTION, this.inputAction],
        ];
    }
    shouldFire = (fireArgs, optionalArgs) => {
        const [player, inputHook, buttonAction] = fireArgs;
        const [callbackPlayerVariant, callbackCharacter, callbackInputHook, callbackButtonAction,] = optionalArgs;
        const character = player.GetPlayerType();
        return ((callbackPlayerVariant === undefined ||
            callbackPlayerVariant === player.Variant) &&
            (callbackCharacter === undefined || callbackCharacter === character) &&
            (callbackInputHook === undefined || callbackInputHook === inputHook) &&
            (callbackButtonAction === undefined ||
                callbackButtonAction === buttonAction));
    };
    // ModCallback.INPUT_ACTION (13)
    inputAction = (entity, inputHook, buttonAction) => {
        if (entity === undefined) {
            return undefined;
        }
        const player = entity.ToPlayer();
        if (player === undefined) {
            return undefined;
        }
        return this.fire(player, inputHook, buttonAction);
    };
}
exports.InputActionPlayer = InputActionPlayer;
