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

namespace VOID.Generic.Requirement
{
    [TypeRegistryItem("MAX Basic Resource")]
    [Serializable]
    public class RequirementMaxBasicResource : IUnitRequirement
    {
        [SerializeField]
        [Required]
        private BasicResourceType _resourceType;
        
        [SerializeField]
        [MinValue(1)]
        private float _resourceValue;
        
        public bool Check(UnitObject unit)
        {
            return unit.basicData.maxResources.Get(_resourceType) >= _resourceValue;
        }
    }
}