"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PakPatch = void 0;
const PatchManager_1 = require("modloader64_api/Patchers/PatchManager");
const PakFormat_1 = require("modloader64_api/PakFormat");
class PakPatch {
    patch(rom, patch) {
        let p = new PakFormat_1.Pak("./temp.pak", patch);
        for (let i = 0; i < p.pak.header.files.length; i++) {
            let entry = p.pak.header.files[i];
            if (entry.filename.indexOf(".bps") > -1) {
                let bps = p.load(i);
                return PatchManager_1.PatchTypes.get(".bps").patch(rom, bps);
            }
        }
        return rom;
    }
}
exports.PakPatch = PakPatch;
//# sourceMappingURL=PakPatch.js.map