"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.onRoomFrame = exports.onRenderFrame = exports.onOrBeforeRoomFrame = exports.onOrBeforeRenderFrame = exports.onOrBeforeGameFrame = exports.onOrAfterRoomFrame = exports.onOrAfterRenderFrame = exports.onOrAfterGameFrame = exports.onGameFrame = exports.isBeforeRoomFrame = exports.isBeforeRenderFrame = exports.isBeforeGameFrame = exports.isAfterRoomFrame = exports.isAfterRenderFrame = exports.isAfterGameFrame = exports.getElapsedRoomFramesSince = exports.getElapsedRenderFramesSince = exports.getElapsedGameFramesSince = void 0;
const cachedClasses_1 = require("../core/cachedClasses");
function getElapsedGameFramesSince(gameFrameCount) {
    const thisGameFrameCount = cachedClasses_1.game.GetFrameCount();
    return thisGameFrameCount - gameFrameCount;
}
exports.getElapsedGameFramesSince = getElapsedGameFramesSince;
function getElapsedRenderFramesSince(renderFrameCount) {
    const thisRenderFrameCount = Isaac.GetFrameCount();
    return thisRenderFrameCount - renderFrameCount;
}
exports.getElapsedRenderFramesSince = getElapsedRenderFramesSince;
function getElapsedRoomFramesSince(roomFrameCount) {
    const room = cachedClasses_1.game.GetRoom();
    const thisRoomFrameCount = room.GetFrameCount();
    return thisRoomFrameCount - roomFrameCount;
}
exports.getElapsedRoomFramesSince = getElapsedRoomFramesSince;
/**
 * Helper function to check if the current game frame count is higher than a specific game frame
 * count.
 */
function isAfterGameFrame(gameFrameCount) {
    const thisGameFrameCount = cachedClasses_1.game.GetFrameCount();
    return thisGameFrameCount > gameFrameCount;
}
exports.isAfterGameFrame = isAfterGameFrame;
/**
 * Helper function to check if the current render frame count is higher than a specific render frame
 * count.
 */
function isAfterRenderFrame(renderFrameCount) {
    const thisRenderFrameCount = Isaac.GetFrameCount();
    return thisRenderFrameCount > renderFrameCount;
}
exports.isAfterRenderFrame = isAfterRenderFrame;
/**
 * Helper function to check if the current room frame count is higher than a specific room frame
 * count.
 */
function isAfterRoomFrame(roomFrameCount) {
    const room = cachedClasses_1.game.GetRoom();
    const thisGameFrameCount = room.GetFrameCount();
    return thisGameFrameCount > roomFrameCount;
}
exports.isAfterRoomFrame = isAfterRoomFrame;
/**
 * Helper function to check if the current game frame count is lower than a specific game frame
 * count.
 */
function isBeforeGameFrame(gameFrameCount) {
    const thisGameFrameCount = cachedClasses_1.game.GetFrameCount();
    return thisGameFrameCount < gameFrameCount;
}
exports.isBeforeGameFrame = isBeforeGameFrame;
/**
 * Helper function to check if the current render frame count is lower than a specific render frame
 * count.
 */
function isBeforeRenderFrame(renderFrameCount) {
    const thisRenderFrameCount = Isaac.GetFrameCount();
    return thisRenderFrameCount < renderFrameCount;
}
exports.isBeforeRenderFrame = isBeforeRenderFrame;
/**
 * Helper function to check if the current room frame count is lower than a specific room frame
 * count.
 */
function isBeforeRoomFrame(roomFrameCount) {
    const room = cachedClasses_1.game.GetRoom();
    const thisGameFrameCount = room.GetFrameCount();
    return thisGameFrameCount < roomFrameCount;
}
exports.isBeforeRoomFrame = isBeforeRoomFrame;
/**
 * Helper function to check if the current game frame count is exactly equal to a specific game
 * frame count.
 *
 * This returns false if the submitted render frame count is null or undefined.
 */
function onGameFrame(gameFrameCount) {
    const thisGameFrameCount = cachedClasses_1.game.GetFrameCount();
    return thisGameFrameCount === gameFrameCount;
}
exports.onGameFrame = onGameFrame;
/**
 * Helper function to check if the current game frame count is equal to or higher than a specific
 * game frame count.
 */
function onOrAfterGameFrame(gameFrameCount) {
    const thisGameFrameCount = cachedClasses_1.game.GetFrameCount();
    return thisGameFrameCount >= gameFrameCount;
}
exports.onOrAfterGameFrame = onOrAfterGameFrame;
/**
 * Helper function to check if the current render frame count is equal to or higher than a specific
 * render frame count.
 */
function onOrAfterRenderFrame(renderFrameCount) {
    const thisRenderFrameCount = Isaac.GetFrameCount();
    return thisRenderFrameCount >= renderFrameCount;
}
exports.onOrAfterRenderFrame = onOrAfterRenderFrame;
/**
 * Helper function to check if the current room frame count is equal to or higher than a specific
 * room frame count.
 */
function onOrAfterRoomFrame(roomFrameCount) {
    const room = cachedClasses_1.game.GetRoom();
    const thisGameFrameCount = room.GetFrameCount();
    return thisGameFrameCount >= roomFrameCount;
}
exports.onOrAfterRoomFrame = onOrAfterRoomFrame;
/**
 * Helper function to check if the current game frame count is equal to or lower than a specific
 * game frame count.
 */
function onOrBeforeGameFrame(gameFrameCount) {
    const thisGameFrameCount = cachedClasses_1.game.GetFrameCount();
    return thisGameFrameCount <= gameFrameCount;
}
exports.onOrBeforeGameFrame = onOrBeforeGameFrame;
/**
 * Helper function to check if the current render frame count is equal to or lower than a specific
 * render frame count.
 */
function onOrBeforeRenderFrame(renderFrameCount) {
    const thisRenderFrameCount = Isaac.GetFrameCount();
    return thisRenderFrameCount <= renderFrameCount;
}
exports.onOrBeforeRenderFrame = onOrBeforeRenderFrame;
/**
 * Helper function to check if the current room frame count is equal to or lower than a specific
 * room frame count.
 */
function onOrBeforeRoomFrame(roomFrameCount) {
    const room = cachedClasses_1.game.GetRoom();
    const thisGameFrameCount = room.GetFrameCount();
    return thisGameFrameCount <= roomFrameCount;
}
exports.onOrBeforeRoomFrame = onOrBeforeRoomFrame;
/**
 * Helper function to check if the current render frame count is exactly equal to a specific render
 * frame count.
 *
 * This returns false if the submitted render frame count is null or undefined.
 */
function onRenderFrame(renderFrameCount) {
    const thisRenderFrameCount = Isaac.GetFrameCount();
    return thisRenderFrameCount === renderFrameCount;
}
exports.onRenderFrame = onRenderFrame;
/**
 * Helper function to check if the current room frame count is exactly equal to a specific room
 * frame count.
 *
 * This returns false if the submitted room frame count is null or undefined.
 */
function onRoomFrame(roomFrameCount) {
    const room = cachedClasses_1.game.GetRoom();
    const thisGameFrameCount = room.GetFrameCount();
    return thisGameFrameCount === roomFrameCount;
}
exports.onRoomFrame = onRoomFrame;
