mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Nodes - Reorganized code
This commit is contained in:
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
|
||||
}
|
||||
Reference in new issue
Block a user