mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
35 lines
812 B
C#
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
|
|
} |