local ____lualib = require("lualib_bundle")
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
local PressurePlateVariant = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateVariant
local ____cachedClasses = require("core.cachedClasses")
local game = ____cachedClasses.game
local ____gridEntitiesSpecific = require("functions.gridEntitiesSpecific")
local getPressurePlates = ____gridEntitiesSpecific.getPressurePlates
--- Helper function to check if all of the pressure plates in the room are pushed.
-- 
-- In this context, "pressure plates" refers to the grid entities that you have to press down in
-- order for the room to be cleared. This function ignores other types of pressure plates, such as
-- the ones that you press to get a reward, the ones that you press to start a Greed Mode wave, and
-- so on.
-- 
-- Returns true if there are no pressure plates in the room.
function ____exports.isAllPressurePlatesPushed(self)
    local room = game:GetRoom()
    local hasPressurePlates = room:HasTriggerPressurePlates()
    if not hasPressurePlates then
        return true
    end
    local pressurePlates = getPressurePlates(nil, PressurePlateVariant.PRESSURE_PLATE)
    return __TS__ArrayEvery(
        pressurePlates,
        function(____, pressurePlate) return pressurePlate.State == PressurePlateState.PRESSURE_PLATE_PRESSED end
    )
end
return ____exports
