mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Nodes - Properly implemented custom VMs
This commit is contained in:
1 parent
7eadc58bee
commit
61d7f1e1fb
8 files changed
+46
-50
No files matched your search
@@ -4,12 +4,10 @@ using Artemis.VisualScripting.Nodes.CustomViewModels;
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Integer-Value", "Outputs an configurable integer value.")]
|
||||
public class StaticIntegerValueNode : Node
|
||||
public class StaticIntegerValueNode : Node<StaticIntegerValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private StaticIntegerValueNodeCustomViewModel _customViewModel = new();
|
||||
|
||||
public OutputPin<int> Output { get; }
|
||||
|
||||
#endregion
|
||||
@@ -20,7 +18,6 @@ namespace Artemis.VisualScripting.Nodes
|
||||
: base("Integer", "Outputs an configurable integer value.")
|
||||
{
|
||||
Output = CreateOutputPin<int>();
|
||||
RegisterCustomViewModel<StaticIntegerValueNodeCustomViewModel>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -29,19 +26,17 @@ namespace Artemis.VisualScripting.Nodes
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Output.Value = _customViewModel.Input;
|
||||
Output.Value = CustomViewModel.Input;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Double-Value", "Outputs a configurable double value.")]
|
||||
public class StaticDoubleValueNode : Node
|
||||
public class StaticDoubleValueNode : Node<StaticDoubleValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private StaticDoubleValueNodeCustomViewModel _customViewModel = new();
|
||||
|
||||
public OutputPin<double> Output { get; }
|
||||
|
||||
#endregion
|
||||
@@ -52,7 +47,6 @@ namespace Artemis.VisualScripting.Nodes
|
||||
: base("Double", "Outputs a configurable double value.")
|
||||
{
|
||||
Output = CreateOutputPin<double>();
|
||||
RegisterCustomViewModel<StaticDoubleValueNodeCustomViewModel>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -61,19 +55,17 @@ namespace Artemis.VisualScripting.Nodes
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Output.Value = _customViewModel.Input;
|
||||
Output.Value = CustomViewModel.Input;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("String-Value", "Outputs a configurable string value.")]
|
||||
public class StaticStringValueNode : Node
|
||||
public class StaticStringValueNode : Node<StaticStringValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private StaticStringValueNodeCustomViewModel _customViewModel = new();
|
||||
|
||||
public OutputPin<string> Output { get; }
|
||||
|
||||
#endregion
|
||||
@@ -84,7 +76,6 @@ namespace Artemis.VisualScripting.Nodes
|
||||
: base("String", "Outputs a configurable string value.")
|
||||
{
|
||||
Output = CreateOutputPin<string>();
|
||||
RegisterCustomViewModel<StaticStringValueNodeCustomViewModel>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -93,7 +84,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Output.Value = _customViewModel.Input;
|
||||
Output.Value = CustomViewModel.Input;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -101,7 +92,5 @@ namespace Artemis.VisualScripting.Nodes
|
||||
|
||||
#region CustomViewModels
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user