Nodes - Reorganized code

This commit is contained in:
Robert committed 2022-03-30 20:10:43 +02:00
1 parent 69b881b044
commit 7c83d5345f
73 files changed
+1055 -738

No files matched your search

@@ -0,0 +1,37 @@
using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Text;
[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
}