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

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