Reworked DSL for better architecture, implemented wall-phasing movement.

This commit is contained in:
=
2026-04-29 15:13:38 +02:00
parent 832fb47ec0
commit a0109891e1
14 changed files with 172 additions and 139 deletions
+25 -4
View File
@@ -1,18 +1,32 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Godot;
public partial class Robot : Node3D
{
public ProgramInterpreter interpreter;
List<ProgramNode> nodes;
bool isExecuting = false;
ProgramNode currentNode;
public override void _Ready()
{
}
public override void _Process(double delta)
{
if (isExecuting)
{
if (currentNode.Execute(this, delta))
{
currentNode = currentNode.nextNode;
if (currentNode == null)
{
isExecuting = false;
}
}
}
}
public void Move()
{
@@ -21,7 +35,14 @@ public partial class Robot : Node3D
public void OnClicked()
{
GetNode<UIHandler>("/root/Main/CanvasLayer/UIHandler").ShowNamingPopup(this);
GetNode<UIHandler>("/root/Main/CanvasLayer/UIHandler").ShowCodingWindow(this);
}
public void SetupExecution(List<ProgramNode> nodes)
{
this.nodes = [.. nodes];
isExecuting = true;
currentNode = nodes[0];
}
}
+1
View File
@@ -40,6 +40,7 @@ public partial class RobotList : PanelContainer
display.OnRobotJumpTo += (robot) =>
{
EmitSignal(SignalName.OnRobotJumpTo, robot);
Visible = false;
};
robotList.AddChild(display);
}