using System;
using UnityEngine;

public class PopcornGameView : MonoBehaviour
{
    [SerializeField] private GameObject startingGuide;
    [SerializeField] private GameObject fire;
    [SerializeField] private GameObject oilEffect;
    [SerializeField] private GameObject streamEffect;
    [SerializeField] private GameObject characterSweat;
    [SerializeField] private GameObject characterFlower;

    public void ResetUI()
    {
        ChangeGuideState(true);
        ChangeFireState(false);
        ChangeCharactorState(ThermalCondition.Cold);
        ChangeStreamState(false);
    }

    public void ChangeGuideState(bool isActive)
    {
        startingGuide.SetActive(isActive);
    }

    public void ChangeFireState(bool isActive)
    {
        fire.SetActive(isActive);
        oilEffect.SetActive(isActive);
    }

    public void ChangeStreamState(bool isActive)
    {
        streamEffect.SetActive(isActive);
    }

    public void ChangeCharactorState(ThermalCondition condition)
    {
        switch (condition)
        {
            case ThermalCondition.Cold:
                characterFlower.gameObject.SetActive(false);
                characterSweat.gameObject.SetActive(false);
                break;
            case ThermalCondition.Yellow:
                characterFlower.gameObject.SetActive(true);
                characterSweat.gameObject.SetActive(false);
                break;
            case ThermalCondition.Hot:
                characterFlower.gameObject.SetActive(false);
                characterSweat.gameObject.SetActive(true);
                break;
            default:
                throw new ArgumentOutOfRangeException(nameof(condition), condition, null);
        }
    }
}
