1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Robert 034879a2c9 Node editor - Implemented node visuals, pin visuals
Node editor - Implemented undo/redo and some commands
2022-03-13 22:07:16 +01:00

37 lines
892 B
C#

using Artemis.Core;
namespace Artemis.VisualScripting.Nodes;
[Node("Format", "Formats the input string.", "Text", InputType = typeof(object), OutputType = typeof(string))]
public class StringFormatNode : Node
{
#region Constructors
public StringFormatNode()
: base("Format", "Formats the input string.")
{
Format = CreateInputPin<string>("Format");
Values = CreateInputPinCollection<object>("Values");
Output = CreateOutputPin<string>("Result");
}
#endregion
#region Methods
public override void Evaluate()
{
Output.Value = string.Format(Format.Value ?? string.Empty, Values.Values.ToArray());
}
#endregion
#region Properties & Fields
public InputPin<string> Format { get; }
public InputPinCollection<object> Values { get; }
public OutputPin<string> Output { get; }
#endregion
}