using System;
using Sirenix.OdinInspector;
using UnityEngine;
using VOID.Generic.Dict;
using VOID.Generic.Objects.Unit;

namespace VOID.Generic.Requirement
{
    [TypeRegistryItem("Main Attribute")]
    [Serializable]
    public class RequirementMainAttribute : IUnitRequirement
    {
        [SerializeField]
        [Required]
        private MainAttributeType _attributeType;
        
        [SerializeField]
        [MinValue(1)]
        private int _attributeValue;
        
        public bool Check(UnitObject unit)
        {
            return unit.unitData.mainAttributes.Get(_attributeType) >= _attributeValue;
        }
    }
}