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);
            }
        }
예제 #2
0
        public CExplicitCastNode()
        {
            CExecutionPin execute = new CExecutionPin()
            {
                Name       = "In",
                TargetNode = null
            };

            InExecutionPins.Add(execute);

            CExecutionPin success = new CExecutionPin()
            {
                Name       = "Succeeded",
                TargetNode = null
            };

            CExecutionPin failed = new CExecutionPin()
            {
                Name       = "Failed",
                TargetNode = null
            };

            OutExecutionPins.Add(success);
            OutExecutionPins.Add(failed);
        }
        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);
            }
        }
예제 #4
0
        public CSetKlaxVariableNode()
        {
            IsImplicit = true;

            CExecutionPin inPin = new CExecutionPin("In");

            InExecutionPins.Add(inPin);

            CExecutionPin outPin = new CExecutionPin("Out");

            OutExecutionPins.Add(outPin);
        }
예제 #5
0
        /// <summary>
        /// Adds a new execution pin. This should only be called upon editor callback.
        /// </summary>
        /// <param name="context">Context which contains all editor node actions that need to be executed after this call</param>
        /// <param name="newPin">The new execution pin that should be added</param>
        /// <param name="index">The index at which the execution pin should be inserted</param>
        /// <param name="bIsIn">Whether the pin acts as in or output</param>
        protected void AddExecutionPin(CNodeChangeContext context, CExecutionPin newPin, int index, bool bIsIn)
        {
            if (bIsIn)
            {
                InExecutionPins.Add(newPin);
            }
            else
            {
                OutExecutionPins.Add(newPin);
            }

            context.Actions.Add(new CAddPinChangeAction(newPin, index, bIsIn));
        }
예제 #6
0
        public CReceiveEventNode()
        {
            CExecutionPin invokedPin = new CExecutionPin()
            {
                Name            = "Out",
                TargetNode      = null,
                TargetNodeIndex = -1,
            };

            OutExecutionPins.Add(invokedPin);

            AllowCopy   = false;
            AllowDelete = false;
        }
예제 #7
0
        public CReceiveEventNode(CKlaxScriptEventInfo targetKlaxEvent)
        {
            CExecutionPin invokedPin = new CExecutionPin()
            {
                Name            = "Out",
                TargetNode      = null,
                TargetNodeIndex = -1,
            };

            OutExecutionPins.Add(invokedPin);
            TargetKlaxEvent = targetKlaxEvent;

            AllowCopy   = false;
            AllowDelete = false;
        }
예제 #8
0
        public override void OnInputLiteralChanged(CNodeChangeContext context, CInputPin pin)
        {
            if (pin == InputPins[0])
            {
                CKlaxScriptTypeInfo newType = pin.Literal as CKlaxScriptTypeInfo;
                if (newType != null)
                {
                    OutExecutionPins.RemoveRange(1, OutExecutionPins.Count - 1);
                    context.Actions.Add(new CSwitchNodeTypeChangeAction(newType.Type));

                    ChangePinType(context, InputPins[1], newType.Type);
                    ChangeNodeName(context, $"Switch ({newType.Name})");
                    InputPins[1].Literal = newType.Type.GetDefaultValue();
                }
            }
        }
예제 #9
0
        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);
            }
        }
예제 #10
0
        private void AddExecutionPins()
        {
            CExecutionPin execute = new CExecutionPin()
            {
                Name       = "In",
                TargetNode = null
            };

            InExecutionPins.Add(execute);

            CExecutionPin done = new CExecutionPin()
            {
                Name       = "Out",
                TargetNode = null
            };

            OutExecutionPins.Add(done);
        }
        public CExecuteFunctionNode()
        {
            CExecutionPin execute = new CExecutionPin()
            {
                Name       = "In",
                TargetNode = null
            };

            InExecutionPins.Add(execute);

            CExecutionPin done = new CExecutionPin()
            {
                Name       = "Out",
                TargetNode = null
            };

            OutExecutionPins.Add(done);
        }
예제 #12
0
        public CBranchNode()
        {
            Name = "Branch";

            CExecutionPin inPin = new CExecutionPin("In");

            InExecutionPins.Add(inPin);

            CExecutionPin truePin = new CExecutionPin("True");

            OutExecutionPins.Add(truePin);

            CExecutionPin falsePin = new CExecutionPin("False");

            OutExecutionPins.Add(falsePin);

            CInputPin conditionPin = new CInputPin("Condition", typeof(bool));

            InputPins.Add(conditionPin);
        }
예제 #13
0
        public CForEachLoopNode()
        {
            Name = "Foreach Loop";

            CExecutionPin execute = new CExecutionPin()
            {
                Name       = "In",
                TargetNode = null
            };

            InExecutionPins.Add(execute);

            CExecutionPin breakExec = new CExecutionPin()
            {
                Name       = "Break",
                TargetNode = null
            };

            InExecutionPins.Add(breakExec);

            CExecutionPin loop = new CExecutionPin()
            {
                Name       = "Loop",
                TargetNode = null
            };

            OutExecutionPins.Add(loop);
            CExecutionPin done = new CExecutionPin()
            {
                Name       = "Done",
                TargetNode = null
            };

            OutExecutionPins.Add(done);

            InputPins.Add(new CInputPin("List", typeof(IList)));

            OutputPins.Add(new COutputPin("Index", typeof(int)));
            OutputPins.Add(new COutputPin("Element", typeof(object)));
        }
예제 #14
0
        public CSwitchNode()
        {
            Name             = "Switch";
            CanAddOutputPins = true;

            CExecutionPin execute = new CExecutionPin()
            {
                Name       = "In",
                TargetNode = null
            };

            InExecutionPins.Add(execute);

            CExecutionPin defaultOutExec = new CExecutionPin()
            {
                Name       = "Default",
                TargetNode = null
            };

            OutExecutionPins.Add(defaultOutExec);

            CInputPin typePin = new CInputPin()
            {
                Name           = "Type",
                bIsLiteralOnly = true,
                Type           = typeof(CKlaxScriptTypeInfo),
                Literal        = typeof(string)
            };

            InputPins.Add(typePin);

            CInputPin objectPin = new CInputPin()
            {
                Name = "Object",
                Type = typeof(object)
            };

            InputPins.Add(objectPin);
        }
        protected override void OnImplicitChanged()
        {
            InExecutionPins.Clear();
            OutExecutionPins.Clear();

            if (!IsImplicit)
            {
                CExecutionPin execute = new CExecutionPin()
                {
                    Name       = "In",
                    TargetNode = null
                };
                InExecutionPins.Add(execute);

                CExecutionPin done = new CExecutionPin()
                {
                    Name       = "Out",
                    TargetNode = null
                };
                OutExecutionPins.Add(done);
            }
        }
예제 #16
0
        public CForLoopNode()
        {
            CExecutionPin execute = new CExecutionPin()
            {
                Name       = "In",
                TargetNode = null
            };

            InExecutionPins.Add(execute);

            CExecutionPin breakExec = new CExecutionPin()
            {
                Name       = "Break",
                TargetNode = null
            };

            InExecutionPins.Add(breakExec);

            CExecutionPin loop = new CExecutionPin()
            {
                Name       = "Loop",
                TargetNode = null
            };

            OutExecutionPins.Add(loop);
            CExecutionPin done = new CExecutionPin()
            {
                Name       = "Done",
                TargetNode = null
            };

            OutExecutionPins.Add(done);

            InputPins.Add(new CInputPin("First Index", typeof(int)));
            InputPins.Add(new CInputPin("Last Index", typeof(int)));

            OutputPins.Add(new COutputPin("Index", typeof(int)));
        }