using Cysharp.Threading.Tasks;
using UnityEngine;
using YachtDice.Modifiers.Core;
using YachtDice.Modifiers.Runtime;

namespace YachtDice.Modifiers.Definition
{
    public abstract class Effect : ScriptableObject, IEffect
    {
        [field: SerializeField] public ModifierPhase Phase { get; private set; } = ModifierPhase.Additive;
        [field: SerializeField] public int Priority { get; private set; }

        public abstract UniTask Apply(ModifierContext context, ModifierInstance instance);

#if UNITY_EDITOR
        public void SetPhaseForTest(ModifierPhase p) => Phase = p;
        public void SetPriorityForTest(int p) => Priority = p;
#endif
    }
}
