1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Robert dc17253518 Visual scripting - Added pin disconnect with MMB
Visual scripting - Added min and max node
2022-08-01 22:26:11 +02:00

35 lines
812 B
C#

using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Mathematics;
[Node("Min", "Outputs the smallest of the connected numeric values.", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
public class MinNumericsNode : Node
{
#region Constructors
public MinNumericsNode()
: base("Min", "Outputs the smallest of the connected numeric values.")
{
Values = CreateInputPinCollection<Numeric>("Values", 2);
Min = CreateOutputPin<Numeric>("Min");
}
#endregion
#region Methods
public override void Evaluate()
{
Min.Value = Values.Values.Min();
}
#endregion
#region Properties & Fields
public InputPinCollection<Numeric> Values { get; }
public OutputPin<Numeric> Min { get; }
#endregion
}