using Intrepid.Sprites;
using Sirenix.OdinInspector;
using UnityEngine;

namespace Intrepid.Utilities.Sprite
{
    public class SpriteAnimationController : AbstractSpriteAnimationServiceController<string>
    {
        [GroupInjections, SerializeField] private SpriteAnimationService spriteAnimationService;
        [GroupConfigurations, SerializeField] private string start;
        
        protected override AbstractSpriteStateAnimationService<string> AnimationService => spriteAnimationService;

        private void Start()
        {
            SpriteAnimation.ChangeAnimation(start);
        }

        [GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
        public void ChangeAnimation(string animationId)
        {
            SpriteAnimation.ChangeAnimation(animationId);
        }
    }
}