local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__ArraySplice = ____lualib.__TS__ArraySplice
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____playerIndex = require("functions.playerIndex")
local getPlayerIndex = ____playerIndex.getPlayerIndex
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {run = {buttonActionPairs = {}}}
____exports.PressInput = __TS__Class()
local PressInput = ____exports.PressInput
PressInput.name = "PressInput"
__TS__ClassExtends(PressInput, Feature)
function PressInput.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.v = v
    self.isActionTriggered = function(____, entity, _inputHook, buttonAction)
        if entity == nil then
            return nil
        end
        local player = entity:ToPlayer()
        if player == nil then
            return nil
        end
        local playerIndex = getPlayerIndex(nil, player)
        do
            local i = #v.run.buttonActionPairs - 1
            while i >= 0 do
                local pair = v.run.buttonActionPairs[i + 1]
                if pair.playerIndex == playerIndex and pair.buttonAction == buttonAction then
                    __TS__ArraySplice(v.run.buttonActionPairs, i)
                    return true
                end
                i = i - 1
            end
        end
        return nil
    end
    self.callbacksUsed = {{ModCallback.INPUT_ACTION, self.isActionTriggered, {InputHook.IS_ACTION_TRIGGERED}}}
end
function PressInput.prototype.pressInput(self, player, buttonAction)
    local playerIndex = getPlayerIndex(nil, player)
    local ____v_run_buttonActionPairs_0 = v.run.buttonActionPairs
    ____v_run_buttonActionPairs_0[#____v_run_buttonActionPairs_0 + 1] = {playerIndex = playerIndex, buttonAction = buttonAction}
end
__TS__DecorateLegacy({Exported}, PressInput.prototype, "pressInput", true)
return ____exports
