using System;
using System.Collections.Generic;
using UnityEngine;

namespace GameFeatures.ProfilesFeature
{
    [CreateAssetMenu(fileName = "NameFontStyle", menuName = "Custom/ProfileFeature/NameFontStyle", order = 0)]
    public class NameFontStyle : ScriptableObject
    {
        public List<NameFontStyleItem> datas;
        
        public bool IsContainFont(int id)
        {
            return datas.FindIndex(item => item.id == id) >= 0;
        }

        public NameFontStyleItem GetFontStyleItem(int id)
        {
            return datas.Find(item => item.id == id);
        }
    }

    [Serializable]
    public class NameFontStyleItem
    {
        public string name;
        public int id;
        public Color color = Color.white;
        public TextOutlineSetting outlineSetting;
        public TextGradientSetting gradientSetting;
        public Material material;
    }
    
    [Serializable]
    public class TextOutlineSetting
    {
        public bool enable;
        public Color color;
        public Vector2 distance;
    }
    
    [Serializable]
    public class TextGradientSetting
    {
        public bool enable;
        public Color topColor;
        public Color bottomColor;
    }
}