﻿using SkidiKit.Core.NodeAction.Common;
using SkidiKit.Mathematics;

namespace SkidiKit.Core.NodeAction.Ease
{
    public class EaseSineOut: ActionEase
    {
        public EaseSineOut(FinateTimeAction innerAction) : base(innerAction)
        {
        }

        public override FinateTimeAction Reverse()
        {
            return new EaseSineIn(InnerAction.Reverse());
        }

        public override NodeActionState StartAction(Drawable target)
        {
            return new EaseSineOutState(target, this);
        }
    }

    internal class EaseSineOutState: ActionEaseState
    {
        public EaseSineOutState(Drawable target, ActionEase action) : base(target, action)
        {
        }

        protected override float Ease(float time)
        {
            return EaseMath.SineOut(time);
        }
    }
}
