import Progression_Manager from "../../Progression/Progression_Manager";
import { Island_Form } from "../Data/Custom Forms/Island_Form";
import Biome_Manager from "../../Biome/Biome_Manager";
export default class Form_Island_Manager {
    static async load(player) {
        const progression = Progression_Manager.get("07b1d6ae-6288-4d5c-93fb-d10737e6f2c0");
        const biome_IDs = progression.biome_IDs;
        const form = new Island_Form();
        form.title("Islands");
        form.empty(0);
        form.empty(0);
        biome_IDs.includes("1d8efb50-dcf7-438d-a2d7-10eae61ce668")
            ? form.button("row_0_desert", "desert_unlocked")
            : form.button("row_0", "desert_locked");
        form.empty(0);
        form.empty(0);
        form.empty(0);
        biome_IDs.includes("1b74fd97-bfd4-47fb-b6d7-0c2fc2970abd")
            ? form.button("row_0_forest", "forest_unlocked")
            : form.button("row_0", "forest_locked");
        form.empty(0);
        form.empty(0);
        form.empty(1);
        biome_IDs.includes("155de1e3-7f78-43bf-aaf6-679045a086a4")
            ? form.button("row_1_mesa", "mesa_unlocked")
            : form.button("row_1", "mesa_locked");
        form.empty(1);
        form.empty(1);
        form.button("row_1_default", "default_unlocked");
        form.empty(1);
        form.empty(1);
        biome_IDs.includes("285cbb0e-3a07-4a30-912e-de57bbf5598e")
            ? form.button("row_1_mountain", "mountain_unlocked")
            : form.button("row_1", "mountain_locked");
        form.empty(1);
        form.empty(2);
        form.empty(2);
        biome_IDs.includes("044fc572-27ae-4faf-8d16-2c31cb989122")
            ? form.button("row_2_nether", "nether_unlocked")
            : form.button("row_2", "nether_locked");
        form.empty(2);
        form.empty(2);
        form.empty(2);
        biome_IDs.includes("5b71f415-12a7-439b-b5f4-127bd83e04b3")
            ? form.button("row_2_ocean", "ocean_unlocked")
            : form.button("row_2", "ocean_locked");
        form.empty(2);
        form.empty(2);
        const result = await form.show(player);
        if (result.canceled)
            return;
        const selected = result.selection;
        if (selected == 22 && biome_IDs.includes("0a809bc5-5690-47d6-a96b-7e2360d26df4")) {
            const biome = Biome_Manager.get("0a809bc5-5690-47d6-a96b-7e2360d26df4");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else if (selected == 11 && biome_IDs.includes("1d8efb50-dcf7-438d-a2d7-10eae61ce668")) {
            const biome = Biome_Manager.get("1d8efb50-dcf7-438d-a2d7-10eae61ce668");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else if (selected == 15 && biome_IDs.includes("1b74fd97-bfd4-47fb-b6d7-0c2fc2970abd")) {
            const biome = Biome_Manager.get("1b74fd97-bfd4-47fb-b6d7-0c2fc2970abd");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else if (selected == 19 && biome_IDs.includes("155de1e3-7f78-43bf-aaf6-679045a086a4")) {
            const biome = Biome_Manager.get("155de1e3-7f78-43bf-aaf6-679045a086a4");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else if (selected == 25 && biome_IDs.includes("285cbb0e-3a07-4a30-912e-de57bbf5598e")) {
            const biome = Biome_Manager.get("285cbb0e-3a07-4a30-912e-de57bbf5598e");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else if (selected == 20 && biome_IDs.includes("044fc572-27ae-4faf-8d16-2c31cb989122")) {
            const biome = Biome_Manager.get("044fc572-27ae-4faf-8d16-2c31cb989122");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else if (selected == 24 && biome_IDs.includes("5b71f415-12a7-439b-b5f4-127bd83e04b3")) {
            const biome = Biome_Manager.get("5b71f415-12a7-439b-b5f4-127bd83e04b3");
            player.teleport(biome.teleport.location, { rotation: biome.teleport.roation });
        }
        else {
            this.load(player);
        }
    }
}
