Implemente code for the take node and added functionality to take the list or array
This commit is contained in:
@@ -83,8 +83,7 @@ namespace Nodify.Calculator
|
||||
sysOp = SystemOperations.TAKE,
|
||||
IsFlowNode = false
|
||||
};
|
||||
takeNode.Input.Add("");
|
||||
takeNode.Output.Add("");
|
||||
takeNode.Input.Add("List");
|
||||
|
||||
var authNode = new OperationInfoViewModel()
|
||||
{
|
||||
@@ -322,6 +321,39 @@ namespace Nodify.Calculator
|
||||
return authOp;
|
||||
}
|
||||
|
||||
if (info.sysOp == SystemOperations.TAKE)
|
||||
{
|
||||
var takeOp = new TakeOperationViewModel
|
||||
{
|
||||
Title = info.Title,
|
||||
SystemOperationType = SystemOperations.TAKE
|
||||
};
|
||||
|
||||
// List input — accepts any shape but only list/array DataTypes
|
||||
foreach (var item in input)
|
||||
{
|
||||
item.Shape = ConnectorShape.Circle;
|
||||
item.ConnectorColor = Color.White;
|
||||
item.IsCopyConnector = true;
|
||||
item.IsTakeListConnector = true;
|
||||
item.Title = "List";
|
||||
takeOp.Input.Add(item);
|
||||
}
|
||||
|
||||
// Nth index input (int type)
|
||||
var nthConnector = new ConnectorViewModel
|
||||
{
|
||||
Title = "Nth",
|
||||
Shape = ConnectorShape.Circle,
|
||||
ConnectorColor = ConnectorViewModel.GetColorForType("int"),
|
||||
DataType = "int"
|
||||
};
|
||||
takeOp.NthConnector = nthConnector;
|
||||
takeOp.Input.Add(nthConnector);
|
||||
|
||||
return takeOp;
|
||||
}
|
||||
|
||||
var sysOp = new SystemOperationViewModel
|
||||
{
|
||||
Title = info.Title,
|
||||
|
||||
Reference in New Issue
Block a user