using System;
using UnityEngine;
using UnityEngine.SceneManagement;
using VContainer;

public class DeathScreenController
{
    private DeathScreenView _view;

    [Inject] private StartScreenController startScreenController;
    public DeathScreenController(DeathScreenView view)
    {
        _view = view;
        _view.backButton.onClick.AddListener(OnBackBtnClicked);
        _view.rePlayButton.onClick.AddListener(OnReplayBtnClicked);
    }
    public void HideDeathScreen()
    {
        _view.Hide();
    }

    private void OnReplayBtnClicked()
    {
        HideDeathScreen();
        SceneManager.LoadScene(0);
        Debug.Log("Game Replayed");
    }

    private void OnBackBtnClicked()
    {
        HideDeathScreen();
        SceneManager.LoadScene(0);
    }

    public void ShowDeathScreen(int score, int highscore)
    {
        _view.Show(score,highscore);
    }
}
