(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:
2026-05-13 22:21:16 +02:00
parent 5893f9f7b9
commit 33a618b0b9
19 changed files with 273 additions and 78 deletions
+25 -1
View File
@@ -1,13 +1,37 @@
using Godot;
using System.Collections.Generic;
public abstract class ProgramNode
{
public ProgramNode nextNode;
public ProgramNode previousNode;
public ProgramNode NegativeNode;
public string DisplayText;
public string lastExecutionMessage;
public abstract NodeResult Execute(Robot robot, double delta);
public abstract ProgramNode Duplicate();
public abstract string Save();
public virtual void SetNextNode(
List<Godot.Collections.Dictionary> connections,
Dictionary<StringName, ProgramNode> availableNodes
)
{
nextNode = null;
if (connections.Count <= 0) return;
nextNode = GetConnectedNode(connections[0], availableNodes);
}
protected ProgramNode GetConnectedNode(
Godot.Collections.Dictionary connection,
Dictionary<StringName, ProgramNode> availableNodes
)
{
StringName nodeName = connection["to_node"].AsStringName();
if (!availableNodes.ContainsKey(nodeName)) return null;
return availableNodes[nodeName];
}
}