public CSelfReferenceNode() { IsImplicit = true; Name = "Self Reference"; OutputPins.Add(new COutputPin("Self", typeof(CEntity))); }
public CExecuteCustomFunctionNode(CCustomFunctionGraph functionGraph) { TargetFunctionGuid = functionGraph.Guid; Name = functionGraph.Name; CExecutionPin inPin = new CExecutionPin("In"); InExecutionPins.Add(inPin); CExecutionPin execPin = new CExecutionPin("Next"); OutExecutionPins.Add(execPin); foreach (var inputParameter in functionGraph.InputParameters) { CInputPin input = new CInputPin(inputParameter.Name, inputParameter.Type); InputPins.Add(input); } foreach (var returnParameter in functionGraph.OutputParameters) { COutputPin output = new COutputPin(returnParameter.Name, returnParameter.Type); OutputPins.Add(output); } }
public CExecuteInterfaceFunctionNode(CKlaxScriptInterfaceFunction targetFunction) { TargetFunctionGuid = targetFunction.Guid; Name = targetFunction.Name; CExecutionPin inPin = new CExecutionPin("In"); InExecutionPins.Add(inPin); CExecutionPin execPin = new CExecutionPin("Next"); OutExecutionPins.Add(execPin); CInputPin targetInput = new CInputPin("Target", typeof(CEntity)); InputPins.Add(targetInput); foreach (var inputParameter in targetFunction.InputParameters) { CInputPin input = new CInputPin(inputParameter.Name, inputParameter.Type); InputPins.Add(input); } foreach (var returnParameter in targetFunction.OutputParameters) { COutputPin output = new COutputPin(returnParameter.Name, returnParameter.Type); OutputPins.Add(output); } }
public InteractNode() : base(NodeType.Interact, UniqueId.NewId()) { Name = "Interact"; Color = 0xFF_32cd32; OutputPins.Add(new FlowOutputPin(PinId.NewId(NodeId, PinType.Output, 0), string.Empty)); }
public VariableGetNode(string variable, string type) : base(NodeType.VariableGet, UniqueId.NewId()) { Name = $"Get Variable - {type}"; Color = HashColorConverter.GetColor(type); OutputPins.Add(new TypeOutputPin(PinId.NewId(NodeId, PinType.Output, 0), variable, type)); }
/// <summary> /// Create a new subnode from a serialized graph /// </summary> /// <param name="buffer"></param> public DaggerSubNode(string name, byte[] buffer) : base() { MemoryStream ms = new MemoryStream(buffer); BinaryFormatter bformatter = new BinaryFormatter(); _subNodeGraph = (DaggerGraph)bformatter.Deserialize(ms); _subNodeName = name; _subNodeGraph._parentSubNode = this; // reflect imported/exported pins to input/output pins foreach (DaggerOutputPin pin in _subNodeGraph.ImportedPins) { DaggerInputPin inpin = new DaggerInputPin(); inpin.Name = pin.Name; inpin.DataType = pin.DataType; InputPins.Add(inpin); } foreach (DaggerInputPin pin in _subNodeGraph.ExportedPins) { DaggerOutputPin outpin = new DaggerOutputPin(); outpin.Name = pin.Name; outpin.DataType = pin.DataType; OutputPins.Add(outpin); } AssociatedUINode = "IDaggerUISubNode"; }
public ConstantReadNode(string serializedValue, string type) : base(NodeType.ConstantRead, UniqueId.NewId()) { Name = $"Constant - {type}"; Color = HashColorConverter.GetColor(type); OutputPins.Add(new TypeOutputPin(PinId.NewId(NodeId, PinType.Output, 0), serializedValue, type)); }
protected NodePin <T> AddOutputPin <T>(string name) { var pin = new NodePin <T>(name, Pins.Count, this); RegisterPin(pin); OutputPins.Add(pin); return(pin); }
protected NodePin <NodePinTypeExecute> AddExecuteOutPin(string name = "Out") { var pin = new NodePin <NodePinTypeExecute>(name, Pins.Count, this); RegisterPin(pin); OutputPins.Add(pin); return(pin); }
public Pin ResolveOutputPin(Connection connection) { if (connection.NodeId != Id) { throw new InvalidOperationException("Wrong node Uid"); } return(OutputPins.FirstOrDefault(_ => _.Id == connection.PinId)); }
public NpcDialogueNode() : base(NodeType.NpcDialogue, UniqueId.NewId()) { Name = "NPC Dialogue"; Color = 0xFF_9370db; InputPins.Add(new FlowInputPin(PinId.NewId(NodeId, PinType.Input, 0))); OutputPins.Add(new FlowOutputPin(PinId.NewId(NodeId, PinType.Output, 0), string.Empty)); }
public TriggerEventNode(string eventName) : base(NodeType.TriggerEvent, UniqueId.NewId()) { Name = "Trigger Event"; Color = 0xFF_bdb76b; InputPins.Add(new FlowInputPin(PinId.NewId(NodeId, PinType.Input, 0))); OutputPins.Add(new FlowOutputPin(PinId.NewId(NodeId, PinType.Output, 0), eventName)); }
protected void RemoveOutputPin(int pinIndex) { if (pinIndex <= OutputPins.Count && OutputPins.Count > 0) { NodeEditor.Logger.Log <Node>("Remove output pin."); var pin = OutputPins[pinIndex]; RemovePin(pin); OutputPins.Remove(pin); } }
public void Initialize(NodeData data) { Name = data.Name; ID = data.ID; Position = data.Position; InputPins.Clear(); // TEMP! OutputPins.Clear(); // TEMP! OnInitialize(); }
protected override void OnSourceVariableChanged() { OutputPins.Clear(); Name = "Get " + SourceVariable.Name; COutputPin output = new COutputPin(SourceVariable.Name, SourceVariable.Type); OutputPins.Add(output); }
public VariableSetNode(string variable, string type) : base(NodeType.VariableSet, UniqueId.NewId()) { Name = $"Set Variable - {type}"; Color = HashColorConverter.GetColor(type); InputPins.Add(new FlowInputPin(PinId.NewId(NodeId, PinType.Input, 0))); InputPins.Add(new TypeInputPin(PinId.NewId(NodeId, PinType.Input, 1), variable, type)); OutputPins.Add(new FlowOutputPin(PinId.NewId(NodeId, PinType.Output, 0), string.Empty)); }
public BranchNode() : base(NodeType.Branch, UniqueId.NewId()) { Name = "Branch"; Color = 0xFF_ff8c00; InputPins.Add(new FlowInputPin(PinId.NewId(NodeId, PinType.Input, 0))); InputPins.Add(new TypeInputPin(PinId.NewId(NodeId, PinType.Input, 1), "Condition", "Z")); OutputPins.Add(new FlowOutputPin(PinId.NewId(NodeId, PinType.Output, 0), "True")); OutputPins.Add(new FlowOutputPin(PinId.NewId(NodeId, PinType.Output, 1), "False")); }
public CComponentVariableNode(CEntityComponent targetComponent) { IsImplicit = true; Name = "Get " + targetComponent.Name; ComponentTargetGuid = targetComponent.ComponentGuid; COutputPin output = new COutputPin(targetComponent.Name, targetComponent.GetType()); OutputPins.Add(output); }
public CImplicitCastNode() { IsImplicit = true; COutputPin successOutput = new COutputPin { Name = "Success", Type = typeof(bool) }; OutputPins.Add(successOutput); }
public ComlinkNode(NodeType nodeType, UniqueId id, float x, float y, uint color, string name, IEnumerable <IInputPin> inputPins, IEnumerable <IOutputPin> outputPins, IEnumerable <Connection> connections) : this(nodeType, id) { X = x; Y = y; Color = color; Name = name; InputPins.AddRange(inputPins); OutputPins.AddRange(outputPins); Connections.AddRange(connections); }
public DaggerTypeConstantNode(Type constantType) { inpin = new DaggerInputPin(); inpin.DataType = constantType; inpin.Name = "Constant Input"; InputPins.Add(inpin); outpin = new DaggerOutputPin(); outpin.DataType = constantType; OutputPins.Add(outpin); AssociatedUINode = typeof(TypeConstantNodeUI); DoProcessing += new ProcessHandler(DaggerTypeConstantNode_DoProcessing); }
protected override void OnSourceVariableChanged() { OutputPins.Clear(); InputPins.Clear(); Name = "Set " + SourceVariable.Name; CInputPin input = new CInputPin(SourceVariable.Name, SourceVariable.Type); InputPins.Add(input); COutputPin output = new COutputPin("NewValue", SourceVariable.Type); OutputPins.Add(output); }
public InTerminal() : base() { logic_element = new LogicCircuitSimulator.InTerminal(); OutputPins.Add(new Visual.Pin(this, PinSide.OUTPUT, 0)); g_circuit.AddElement(logic_element); image_data = new ConnectableImages.ITERM(); picture_box = new System.Windows.Forms.PictureBox { Name = elements.Count.ToString(), Location = new Point(100, 200), Size = new Size(20, 5), Image = image_data.Image }; }
public SchemeState(Topology.Topology topology) { Gates = topology.Gates.ToDictionary(x => x, x => new GateState(x, false)); Nodes = topology.Nodes.ToDictionary(x => x, x => new NodeState(x, false)); InputPins = topology.Pins.Where(x => !x.IsOutputPin).ToArray(); OutputPins = topology.Pins.Where(x => x.IsOutputPin).ToArray(); PinNodes = topology.Pins.ToDictionary( p => p, p => (IReadOnlyList <SchemeNode>)topology.Nodes.Where(n => n.Pins.Contains(p)).ToArray()); InputPinStates = InputPins.ToDictionary(x => x, x => new PinState(x, false, x.ValuesFunction.Begin(topology.ValuesFunctions))); OutputPinStates = OutputPins.ToDictionary(x => x, x => new PinState(x, false, x.ValuesFunction.Begin(topology.ValuesFunctions))); GeneratedOutputPinsStates = OutputPins.ToDictionary(x => x, _ => false); }
public void Deserialize(BinaryReader reader) { Id = reader.ReadInt32(); GroupId = reader.ReadInt32(); Category = (NodeCategory)reader.ReadInt32(); Type = reader.ReadString(); Name = reader.ReadString(); var hasValue = reader.ReadBoolean(); if (hasValue) { Value = reader.ReadString(); } var pinsCount = reader.ReadInt32(); for (var i = 0; i < pinsCount; i++) { var pin = new Pin(); pin.Deserialize(reader); EnterPins.Add(pin); } pinsCount = reader.ReadInt32(); for (var i = 0; i < pinsCount; i++) { var pin = new PinWithConnection(); pin.Deserialize(reader); InputPins.Add(pin); } pinsCount = reader.ReadInt32(); for (var i = 0; i < pinsCount; i++) { var pin = new PinWithConnection(); pin.Deserialize(reader); ExitPins.Add(pin); } pinsCount = reader.ReadInt32(); for (var i = 0; i < pinsCount; i++) { var pin = new Pin(); pin.Deserialize(reader); OutputPins.Add(pin); } }
public CFunctionGraphEntryNode(List <CKlaxVariable> inputParameters) { AllowDelete = false; AllowCopy = false; Name = "Entry"; CExecutionPin execPin = new CExecutionPin("Next"); OutExecutionPins.Add(execPin); foreach (var inputParameter in inputParameters) { COutputPin output = new COutputPin(inputParameter.Name, inputParameter.Type); OutputPins.Add(output); } }
void RemovePin(NodePin pin) { Pins.Remove(pin); if (pin.IsInput) { InputPins.Remove(pin); } else { OutputPins.Remove(pin); } PinRemoved.InvokeSafe(pin); pin.Connected -= OnPinConnected; TriggerChange(); }
protected NodePin AddPin(string name, Type type, bool isOutput) { var classType = typeof(NodePin <>).MakeGenericType(type); var pin = Activator.CreateInstance(classType, name, Pins.Count, this) as NodePin; RegisterPin(pin); if (isOutput) { OutputPins.Add(pin); } else { InputPins.Add(pin); } return(pin); }
public ScriptNode Build() { var node = new ScriptNode(); node.Type = Type; node.Name = Name; if (OutputTypes.Any()) { node.Category = NodeCategory.Function; } else { node.Category = NodeCategory.Result; } node.InputPins.AddRange(InputPins.Select(_ => _.Clone())); node.OutputPins.AddRange(OutputPins.Select(_ => _.Clone())); return(node); }
protected override void OnTargetFieldChanged() { if (TargetField == null) { throw new NullReferenceException("Target Field cannot be null as this would make the node invalid"); } InputPins.Clear(); OutputPins.Clear(); CInputPin targetObjectInput = new CInputPin("Target", TargetField.DeclaringType); InputPins.Add(targetObjectInput); Name = "Get " + TargetField.Name; COutputPin outputPin = new COutputPin(TargetField.Name, TargetField.FieldType); OutputPins.Add(outputPin); }