using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class CardUI : MonoBehaviour
{
    [SerializeField] private string cardname;
    [SerializeField] private PlayerSkillTree.Skills skill;

    [SerializeField] private PotionHandler.PotionType potionType = PotionHandler.PotionType.None;

    public PlayerSkillTree.Skills Skill { get => skill; private set => skill = value; }
    public string Name { get => cardname; private set => cardname = value; }

    private void Start()
    {
        Skill = skill;
        GetComponent<Button>().onClick.AddListener(OnCardClicked);
    }

    private void OnCardClicked()
    {
        CardManager.Instance.SelectCard(Skill, potionType);
    }
}