(WIP) Switch from previous DSL System (UI order based) to a new DSL System (node connection based) still in Progress.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class IfNode : ProgramNode
|
||||
{
|
||||
@@ -56,4 +57,27 @@ public class IfNode : ProgramNode
|
||||
{
|
||||
return $"Name: {DisplayText}, Item: {(selectedItem == null ? "Empty" : selectedItem.data.Id)}, Comparator: {comparator}, Amount: {amount}";
|
||||
}
|
||||
|
||||
public override void SetNextNode(
|
||||
List<Godot.Collections.Dictionary> connections,
|
||||
Dictionary<StringName, ProgramNode> availableNodes
|
||||
)
|
||||
{
|
||||
nextNode = null;
|
||||
NegativeNode = null;
|
||||
|
||||
foreach (Godot.Collections.Dictionary connection in connections)
|
||||
{
|
||||
int port = (int)connection["from_port"];
|
||||
ProgramNode connectedNode = GetConnectedNode(connection, availableNodes);
|
||||
if (port == 0)
|
||||
{
|
||||
nextNode = connectedNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
NegativeNode = connectedNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user