public NodeData(Node <INode> _node, ConstellationScript ConstellationNode) { AttributesData = new List <AttributeData>(); Inputs = new List <InputData>(); Outputs = new List <OutputData>(); foreach (Input input in _node.GetInputs()) { Inputs.Add(new InputData(input.Guid, input.isWarm, input.Type, input.Description)); } foreach (Output output in _node.GetOutputs()) { Outputs.Add(new OutputData(output.Guid, output.IsWarm, output.Type, output.Description)); } foreach (Attribute attribute in _node.GetAttributes()) { AttributesData.Add(new AttributeData(attribute.Type, attribute.Value)); } if (_node.GetGuid() == null) { _node.Initialize(System.Guid.NewGuid().ToString(), _node.Name); } XPosition = _node.XPosition; YPosition = _node.YPosition; Name = _node.Name; Namespace = _node.Namespace; Guid = _node.GetGuid(); }
public NodeData AddCustomNode(Node <INode> _node, ConstellationScript constellation) { if (script.Nodes == null) { script.Nodes = new List <NodeData>(); } var newNode = new NodeData(_node); script.Nodes.Add(newNode); return(newNode); }
public void SetConstellationScript(ConstellationScript constellationScript) { ConstellationData = constellationScript; }