"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostGreedModeWave = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const cachedClasses_1 = require("../../core/cachedClasses");
const CustomCallback_1 = require("../private/CustomCallback");
const v = {
    run: {
        currentGreedWave: 0,
    },
};
class PostGreedModeWave extends CustomCallback_1.CustomCallback {
    v = v;
    constructor() {
        super();
        this.callbacksUsed = [
            // 1
            [isaac_typescript_definitions_1.ModCallback.POST_UPDATE, this.postUpdate],
        ];
    }
    // ModCallback.POST_UPDATE (1)
    postUpdate = () => {
        if (!cachedClasses_1.game.IsGreedMode()) {
            return;
        }
        const level = cachedClasses_1.game.GetLevel();
        const newWave = level.GreedModeWave;
        const oldWave = v.run.currentGreedWave;
        v.run.currentGreedWave = newWave;
        if (newWave > oldWave) {
            this.fire(oldWave, newWave);
        }
    };
}
exports.PostGreedModeWave = PostGreedModeWave;
