Пример #1
0
            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));
            }
Пример #2
0
            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);
            }
Пример #3
0
 public void RegisterNodeStructure(NodeStructure structure)
 {
     nodeStructures.Add(structure.Name, structure);
 }