"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OwlStatues = void 0;
const Z64CORE = __importStar(require("../importsZ64"));
const FlagManager_1 = require("modloader64_api/FlagManager");
const JSONTemplate_1 = require("modloader64_api/JSONTemplate");
class OwlStatues extends JSONTemplate_1.JSONTemplate {
    instance = Z64CORE.Z64.Z64_SAVE; // Save Context
    owlFlags;
    owlFlagsAddr = this.instance + 0x46;
    jsonFields = [
        "greatBayCoast",
        "zoraCape",
        "snowhead",
        "mountainVillage",
        "clockTown",
        "milkRoad",
        "woodfall",
        "southernSwamp",
        "ikanaCanyon",
        "stoneTower",
        "hiddenOwlStatue"
    ];
    constructor(emu) {
        super();
        this.owlFlags = new FlagManager_1.FlagManager(emu, this.owlFlagsAddr);
    }
    // Byte 0x0
    // hiddenOwlStatue: boolean; //bit 7
    // bits 6-2 unused
    // stoneTower: boolean; //bit 1
    // ikanaCanyon: boolean; //bit 0
    // Byte 0x1
    // southernSwamp: boolean; //bit 7
    // woodfall: boolean; //bit 6
    // milkRoad: boolean; //bit 5
    // clockTown: boolean; // bit 4
    // mountainVillage: boolean; //bit 3
    // snowhead: boolean; //bit 2
    // zoraCape: boolean; //bit 1
    // greatBayCoast: boolean; //bit 0
    hiddenOwlStatueFlag = new FlagManager_1.Flag(0x0, 0x0);
    get hiddenOwlStatue() {
        return this.owlFlags.isFlagSet(this.hiddenOwlStatueFlag);
    }
    set hiddenOwlStatue(bool) {
        this.owlFlags.setFlag(this.hiddenOwlStatueFlag, bool);
    }
    stoneTowerFlag = new FlagManager_1.Flag(0x0, 0x6);
    get stoneTower() {
        return this.owlFlags.isFlagSet(this.stoneTowerFlag);
    }
    set stoneTower(bool) {
        this.owlFlags.setFlag(this.stoneTowerFlag, bool);
    }
    ikanaCanyonFlag = new FlagManager_1.Flag(0x0, 0x7);
    get ikanaCanyon() {
        return this.owlFlags.isFlagSet(this.ikanaCanyonFlag);
    }
    set ikanaCanyon(bool) {
        this.owlFlags.setFlag(this.ikanaCanyonFlag, bool);
    }
    southernSwampFlag = new FlagManager_1.Flag(0x1, 0x0);
    get southernSwamp() {
        return this.owlFlags.isFlagSet(this.southernSwampFlag);
    }
    set southernSwamp(bool) {
        this.owlFlags.setFlag(this.southernSwampFlag, bool);
    }
    woodfallFlag = new FlagManager_1.Flag(0x1, 0x1);
    get woodfall() {
        return this.owlFlags.isFlagSet(this.woodfallFlag);
    }
    set woodfall(bool) {
        this.owlFlags.setFlag(this.woodfallFlag, bool);
    }
    milkRoadFlag = new FlagManager_1.Flag(0x1, 0x2);
    get milkRoad() {
        return this.owlFlags.isFlagSet(this.milkRoadFlag);
    }
    set milkRoad(bool) {
        this.owlFlags.setFlag(this.milkRoadFlag, bool);
    }
    clockTownFlag = new FlagManager_1.Flag(0x1, 0x3);
    get clockTown() {
        return this.owlFlags.isFlagSet(this.clockTownFlag);
    }
    set clockTown(bool) {
        this.owlFlags.setFlag(this.clockTownFlag, bool);
    }
    mountainVillageFlag = new FlagManager_1.Flag(0x1, 0x4);
    get mountainVillage() {
        return this.owlFlags.isFlagSet(this.mountainVillageFlag);
    }
    set mountainVillage(bool) {
        this.owlFlags.setFlag(this.mountainVillageFlag, bool);
    }
    snowheadFlag = new FlagManager_1.Flag(0x1, 0x5);
    get snowhead() {
        return this.owlFlags.isFlagSet(this.snowheadFlag);
    }
    set snowhead(bool) {
        this.owlFlags.setFlag(this.snowheadFlag, bool);
    }
    zoraCapeFlag = new FlagManager_1.Flag(0x1, 0x6);
    get zoraCape() {
        return this.owlFlags.isFlagSet(this.zoraCapeFlag);
    }
    set zoraCape(bool) {
        this.owlFlags.setFlag(this.zoraCapeFlag, bool);
    }
    greatBayCoastFlag = new FlagManager_1.Flag(0x1, 0x7);
    get greatBayCoast() {
        return this.owlFlags.isFlagSet(this.greatBayCoastFlag);
    }
    set greatBayCoast(bool) {
        this.owlFlags.setFlag(this.greatBayCoastFlag, bool);
    }
}
exports.OwlStatues = OwlStatues;
//# sourceMappingURL=OwlStatues.js.map