#nullable enable


namespace TagFighter.Effects.Steps
{
    using System.Collections.Generic;

    [StepType(StepTypeAttribute.GetterStep)]
    public class ConeAreaGet : OutputStep<IAreaOfEffect>
    {
        [UnityEngine.SerializeField]
        SinglePort<double> _radius = new() {
            DisplayName = "Radius"
        };

        [UnityEngine.SerializeField]
        SinglePort<double> _angle = new() {
            DisplayName = "Angle"
        };

        public override IEnumerable<IPort> Inputs {
            get {
                yield return _radius;
                yield return _angle;
            }
        }

        public override string ToString() => "Cone AOE";

        public override bool IsValid => true;

        public override IAreaOfEffect Run(EffectInput blackBoard) => new ConeArea() {
            Radius = (float)(_radius.Node != null ? _radius.Node.Run(blackBoard) : default),
            Angle = (float)(_angle.Node != null ? _angle.Node.Run(blackBoard) : default),
        };
    }
}