using UnityEngine;

namespace Darkmatter.Core.Data.Static.Features.ShapeBuilder
{
    [CreateAssetMenu(fileName = "ShapeBuilderConfig",
                     menuName = "Darkmatter/ShapeBuilder/Config")]
    public sealed class ShapeBuilderConfig : ScriptableObject
    {
        [Header("Radii (canvas units; reference resolution 2048x2048)")]
        [SerializeField] private float snapRadius          = 100f;
        [SerializeField] private float snapGraceMultiplier = 1.5f;
        [SerializeField] private float previewRadius       = 200f;

        [Header("Tween durations (seconds)")]
        [SerializeField] private float snapDuration   = 0.25f;
        [SerializeField] private float returnDuration = 0.25f;

        [Header("Preview easing")]
        [SerializeField] private AnimationCurve previewCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);

        public float SnapRadius          => snapRadius;
        public float PreviewRadius       => previewRadius;
        public float SnapDuration        => snapDuration;
        public float ReturnDuration      => returnDuration;
        public AnimationCurve PreviewCurve => previewCurve;

        public Vector2 DragSizeDelta(ShapeSO shape) =>
            shape != null ? shape.DefaultSizeDelta : new Vector2(256, 256);
    }
}
