Added basic components for DSL. Working on functionality next.

This commit is contained in:
=
2026-04-28 13:52:57 +02:00
parent 287cb4df78
commit b926be307e
22 changed files with 293 additions and 45 deletions
+14
View File
@@ -0,0 +1,14 @@
using Godot;
public class CraftNode : ProgramNode
{
public CraftNode()
{
DisplayText = "Craft";
}
public override void Execute(Robot robot)
{
GD.Print("Craft");
nextNode.Execute(robot);
}
}
+1
View File
@@ -0,0 +1 @@
uid://dcm23bpi37va
+14
View File
@@ -0,0 +1,14 @@
using Godot;
public class HarvestNode : ProgramNode
{
public HarvestNode()
{
DisplayText = "Harvest";
}
public override void Execute(Robot robot)
{
GD.Print("Harvest");
nextNode.Execute(robot);
}
}
+1
View File
@@ -0,0 +1 @@
uid://bb8g5ukg7xnw
+16
View File
@@ -0,0 +1,16 @@
using Godot;
public class MoveNode : ProgramNode
{
public Vector3 startPosition;
public Vector3 targetPosition;
public MoveNode()
{
DisplayText = "Move";
}
public override void Execute(Robot robot)
{
robot.Position = targetPosition;
nextNode.Execute(robot);
}
}
+1
View File
@@ -0,0 +1 @@
uid://c1yd2vdej67q3
+18
View File
@@ -0,0 +1,18 @@
using Godot;
public abstract class ProgramNode
{
protected ProgramNode nextNode;
public string DisplayText;
public PackedScene editorDisplay;
public ProgramNode()
{
}
public abstract void Execute(Robot robot);
public void LinkNode(ProgramNode nextNode)
{
this.nextNode = nextNode;
}
}
+1
View File
@@ -0,0 +1 @@
uid://hc0yntn2d358