using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class MainMenu : MonoBehaviour
{
    private int selectedLevel;

    private Dictionary<int, int> levels = new Dictionary<int, int>()
    {
        {0,   1}, // Tutorial 1     2PlatzhalterTutorial
        {1,   2}, // Story 1        3MeowlinTalk
        {2,   3}, // Level 1        4DScene
        {3,   4}, // Tutorial 2     5.0TutorialDimshift
        {4,   7}, // Story 2        6.0Luna
        {5,  10}, // Level 2        7Prototype
        {6,  11}, // Story 3        8Francois
        {7,  12}, // Level 3        9Catman1
        {8,  13}, // Story 4        10Conflict
        {9,  14}, // Level 4        11Catman2
        {10, 15}, // Level 5        14Level_Vanessa
        {11, 16}, // Boss           15.0BossVorher
        {12, 21}  // Credits        17CreditsScene
    };

    public void startGame()
    {
        Debug.Log("Main Menu: New Game");
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex+1);
    }

    public void endGame()
    {
        Debug.Log("Main Menu: Quit Game");
        Application.Quit();
    }

    public void setSelectedLeve(int level)
    {
        selectedLevel = ++level;
    }

    public void loadScene()
    {
        Debug.Log("Main Menu: Load Level " + levels[selectedLevel]);
        SceneManager.LoadScene(levels[selectedLevel]);
    }
}
