public Tuple <DataType, NodeStructure> Type( string name, ConstantType constantType, params dynamic[] constantParams ) { DataType type = new DataType { Name = name }; registry.Registry.RegisterDataType(type); NodeStructure structure = null; if (constantType != ConstantType.None) { structure = new NodeStructure { Name = name + "Constant", ConstantType = constantType, ConstantParams = constantParams.Cast <string>().ToList(), Inputs = new List <Variable>(), Outputs = new List <Variable> { new Variable(type, "value") } }; registry.Registry.RegisterNodeStructure(structure); } return(new Tuple <DataType, NodeStructure>(type, structure)); }
public NodeStructure Node(string name, dynamic inputs, dynamic outputs) { IEnumerable <Variable> inputVars = ((IEnumerable <object>)inputs).Cast <Variable>(), outputVars = ((IEnumerable <object>)outputs).Cast <Variable>(); NodeStructure structure = new NodeStructure { Name = name, Inputs = inputVars.ToList(), Outputs = outputVars.ToList() }; registry.Registry.RegisterNodeStructure(structure); return(structure); }
public void RegisterNodeStructure(NodeStructure structure) { nodeStructures.Add(structure.Name, structure); }