Files
bluflame/intromat/Intromat/Nodes/ExecutionNodeBase.cs
2026-04-18 22:31:51 +02:00

45 lines
1.3 KiB
C#

using System;
using System.Reactive;
using System.Reactive.Linq;
using DynamicData;
using Intromat.Model.Compiler;
using Intromat.ViewModels;
using NodeNetwork.Toolkit.ValueNode;
using NodeNetwork.ViewModels;
namespace Intromat.Nodes
{
public abstract class ExecutionNodeBase : CodeGenNodeViewModel
{
protected readonly EndpointGroup _executionFlowGroup;
protected ExecutionNodeBase(NodeType type)
: base(type)
{
_executionFlowGroup = new EndpointGroup("Execution Flow");
FlowOut = new CodeGenInputViewModel<IStatement>(EPortType.Execution)
{
Name = "Flow",
Group = _executionFlowGroup
};
Inputs.Add(FlowOut);
FlowOutChanged = FlowOut.ValueChanged.Select(_ => Unit.Default).StartWith(Unit.Default);
FlowIn = new CodeGenOutputViewModel<IStatement>(EPortType.Execution)
{
Name = "Flow",
Group = _executionFlowGroup
};
Outputs.Add(FlowIn);
}
public ValueNodeOutputViewModel<IStatement> FlowIn { get; }
public ValueNodeInputViewModel<IStatement> FlowOut { get; }
public IObservable<Unit> FlowOutChanged { get; }
}
}