using UnityEngine;
using YachtDice.Modifiers.Core;
using YachtDice.Modifiers.Definition;
using YachtDice.Modifiers.Runtime;

namespace YachtDice.Modifiers.Conditions
{
    [CreateAssetMenu(fileName = "MinScoreCondition", menuName = "YachtDice/Modifiers/Conditions/Min Score")]
    public class MinScoreCondition : Condition
    {
        [SerializeField] private int minimumBaseScore;

        public override bool Evaluate(ModifierContext context, ModifierInstance instance)
        {
            return context.BaseScore >= minimumBaseScore;
        }

#if UNITY_EDITOR
        public static MinScoreCondition CreateForTest(int minScore)
        {
            var so = CreateInstance<MinScoreCondition>();
            so.minimumBaseScore = minScore;
            return so;
        }
#endif
    }
}
