using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class UIDayEndMenu : MonoBehaviour, IMenuState
{
    [SerializeField] private Button newDay;
    [SerializeField] private TextMeshProUGUI missingHousing;
    [SerializeField] private TextMeshProUGUI foodEaten;
    [SerializeField] private TextMeshProUGUI missingFood;
    [SerializeField] private TextMeshProUGUI peopleLeaving;

    private void Start()
    {
        newDay.onClick.AddListener(StartDay);
        gameObject.SetActive(false);
    }

    private void StartDay()
    {
        MenuManager.Instance.MenuTransition(MenuManager.Instance.inGameMenu);
        Events.DayStart();
    }

    public void Enter()
    {
        missingHousing.text = PeopleManager.Instance.MissingHousing.ToString();
        foodEaten.text = PeopleManager.Instance.FoodEaten.ToString();
        missingFood.text = PeopleManager.Instance.MissingFood.ToString();
        peopleLeaving.text = PeopleManager.Instance.PeopleLeaving.ToString();
        gameObject.SetActive(true);
    }

    public void UpdateMenu() { }

    public void Exit()
    {
        gameObject.SetActive(false);
    }
}
