using UnityEngine;

public class MenuCallbackHolder
{
    private System.Action[] callbacks;

    public MenuCallbackHolder()
    {
        callbacks = new System.Action[]
        {
            PlayButtonCallback,
            InstruccionsButtonCallback,
            SetupButtonCallback,
            ZapButtonCallback,
            AboutButtonCallback,
            QuitButtonCallback
        };
    }

    public void InvokeCallback(int index)
    {
        if (index >= 0 && index < callbacks.Length)
        {
            callbacks[index].Invoke();
        }
        else
        {
            Debug.LogWarning($"MenuCallbackHolder: Invalid callback index {index}");
        }
    }

    public void PlayButtonCallback()
    {
        Debug.Log("Play button pressed");
        UnityEngine.SceneManagement.SceneManager.LoadScene("Game");
    }

    public void InstruccionsButtonCallback()
    {
        Debug.Log("Instructions button pressed");
        // UnityEngine.SceneManagement.SceneManager.LoadScene("Instructions");
    }

    public void SetupButtonCallback()
    {
        Debug.Log("Setup button pressed");
        // UnityEngine.SceneManagement.SceneManager.LoadScene("Setup");
    }

    public void ZapButtonCallback()
    {
        Debug.Log("Zap Scores button pressed");
        // UnityEngine.SceneManagement.SceneManager.LoadScene("Zap");
    }

    public void AboutButtonCallback()
    {
        Debug.Log("About button pressed");
        // UnityEngine.SceneManagement.SceneManager.LoadScene("About");
    }

    public void QuitButtonCallback()
    {
        Debug.Log("Quit button pressed");
        Application.Quit();
    }
}