Cleaned up project with better structure.

This commit is contained in:
2026-05-09 11:29:48 +02:00
parent 1ad3454f6a
commit 6708aa277f
95 changed files with 711 additions and 700 deletions
+5 -4
View File
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using Godot;
@@ -13,12 +12,14 @@ public class MoveNode : ProgramNode
}
public override NodeResult Execute(Robot robot, double delta)
{
pathPoints ??= [.. Pathfinding.GetPath(Pathfinding.GetClosestStartPoint(robot.Position), targetPosition)];
pathPoints ??= new List<Vector3>(Pathfinding.GetPath(Pathfinding.GetClosestStartPoint(robot.Position), targetPosition));
if (pathPoints.Count <= 0)
{
lastExecutionMessage = "No path available";
return NodeResult.FAILURE;
}
startPosition = robot.Position;
Vector3 target = pathPoints[0] - startPosition;
float distance = target.Length();
@@ -32,6 +33,7 @@ public class MoveNode : ProgramNode
{
tile.VisitTile();
}
pathPoints.Remove(pathPoints[0]);
if (pathPoints.Count <= 0)
{
@@ -74,11 +76,10 @@ public class MoveNode : ProgramNode
public override void Setup(NodeDisplay display)
{
//Currently does nothing
}
public override string Save()
{
return $"Name: {DisplayText}, Position: ({targetPosition.X}|{targetPosition.Y}|{targetPosition.Z})";
}
}
}