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); } }
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); } }
public CSetKlaxVariableNode() { IsImplicit = true; CExecutionPin inPin = new CExecutionPin("In"); InExecutionPins.Add(inPin); CExecutionPin outPin = new CExecutionPin("Out"); OutExecutionPins.Add(outPin); }
/// <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)); }
public CReceiveEventNode() { CExecutionPin invokedPin = new CExecutionPin() { Name = "Out", TargetNode = null, TargetNodeIndex = -1, }; OutExecutionPins.Add(invokedPin); AllowCopy = false; AllowDelete = false; }
public CReceiveEventNode(CKlaxScriptEventInfo targetKlaxEvent) { CExecutionPin invokedPin = new CExecutionPin() { Name = "Out", TargetNode = null, TargetNodeIndex = -1, }; OutExecutionPins.Add(invokedPin); TargetKlaxEvent = targetKlaxEvent; AllowCopy = false; AllowDelete = false; }
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(); } } }
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); } }
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); }
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); }
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))); }
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); } }
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))); }