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(EPortType.Execution) { Name = "Flow", Group = _executionFlowGroup }; Inputs.Add(FlowOut); FlowOutChanged = FlowOut.ValueChanged.Select(_ => Unit.Default).StartWith(Unit.Default); FlowIn = new CodeGenOutputViewModel(EPortType.Execution) { Name = "Flow", Group = _executionFlowGroup }; Outputs.Add(FlowIn); } public ValueNodeOutputViewModel FlowIn { get; } public ValueNodeInputViewModel FlowOut { get; } public IObservable FlowOutChanged { get; } } }