using UnityEngine;
using System.Collections.Generic;
using System;

public static class ChangingPlane {

    // Dictionary that contains the doors that connect scenes.
    public static Dictionary<string, string> doorsBetW = new Dictionary<string, string>();

    // Dictionary that contains the exit point of the doors that connect scenes.
    public static Dictionary<string, Vector3> pos = new Dictionary<string, Vector3>();
    

    // Creation of the dictionaries. Is something manual...
    public static void Load(){
        ChangingPlane.doorsBetW["world0"] = "0-12";
        ChangingPlane.pos      ["world0"] = new Vector3(15f, 2, 57f);
        
        ChangingPlane.doorsBetW["world1"] = "0-11";
        ChangingPlane.pos      ["world1"] = new Vector3(-45f, 2, 102f);

        ChangingPlane.doorsBetW["dungeon10"] = "1-0";
        ChangingPlane.pos      ["dungeon10"] = new Vector3(0f, 12f, -27f);

        ChangingPlane.doorsBetW["dungeon11"] = "0-2";
        ChangingPlane.pos["dungeon11"] = new Vector3(2.3f, -8f, -9f);

        ChangingPlane.doorsBetW["NewGame"] = "0-1";
        ChangingPlane.pos["NewGame"] = new Vector3(0,2f,0);
    }


    // Returns the floor of a concrete exit in a scene.
    public static string getPlane(string world, int enter) {
        ChangingPlane.Load();
        return ChangingPlane.doorsBetW[world + "" + enter];
    }

    // Returns the exit position of a concrete exit in a scene.
    public static Vector3 getPos(string world, int enter) {
        ChangingPlane.Load();
        return ChangingPlane.pos[world + "" + enter];
    }

    // Returns the initial position of the new game.
    public static Vector3 getInitPos() {
        ChangingPlane.Load();
        return ChangingPlane.pos["NewGame"];
    }

    // Returns the initial plane of the new game.
    public static string getInitPlane() {
        ChangingPlane.Load();
        return ChangingPlane.doorsBetW["NewGame"];
    }


}
