Beispiel #1
0
        public void WriteInputs(GraphCaller graph, IList <GraphInput> inputs, IVariableDictionary variables)
        {
            foreach (var input in inputs)
            {
                if (input.Type == GraphInputType.Expression)
                {
                    var value      = input.Expression.Execute(variables);
                    var definition = graph?.Graph.GetInputDefinition(input);

                    value = ResolveValue(definition, value, graph.Graph, _invalidInputError, definition.Name);

                    if (!value.IsEmpty)
                    {
                        if (Input.AddVariable(input.Name, value) == SetVariableResult.NotFound)
                        {
                            Input.SetVariable(input.Name, value);
                        }
                    }
                    else
                    {
                        Debug.LogWarningFormat(_missingInputError, input.Name, graph.Graph, input.Expression);
                    }
                }
                else if (input.Type == GraphInputType.Value)
                {
                    if (Input.AddVariable(input.Name, input.Value.Variable) == SetVariableResult.NotFound)
                    {
                        Input.SetVariable(input.Name, input.Value.Variable);
                    }
                }
            }
        }
Beispiel #2
0
 public void ReadOutputs(GraphCaller graph, IList <GraphOutput> outputs, IVariableDictionary variables)
 {
     foreach (var output in outputs)
     {
         if (output.Type == GraphOutputType.Expression)
         {
             var value = Output.GetVariable(output.Name);
             output.Expression.Assign(variables, value);
         }
     }
 }
Beispiel #3
0
        public void RunGraph(GraphCaller caller, IVariableDictionary variables)
        {
            var enumerator = caller.Execute(variables);

            RunEnumerator(enumerator);
        }
Beispiel #4
0
 public void RunGraph(GraphCaller caller)
 {
     RunGraph(caller, VariableContext.Default);
 }